From ca4f115229345e33967964b76dbc202f3c971385 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Fri, 9 Nov 2018 19:59:22 +0100 Subject: [PATCH 01/17] friendica-6101 slow travis-ci tests --- composer.json | 3 ++- composer.lock | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5df9a5355b..339211f6f0 100644 --- a/composer.json +++ b/composer.json @@ -76,7 +76,8 @@ "phpdocumentor/reflection-docblock": "^3.0.2", "phpunit/php-token-stream": "^1.4.2", "mikey179/vfsStream": "^1.6", - "mockery/mockery": "^1.2" + "mockery/mockery": "^1.2", + "johnkary/phpunit-speedtrap": "1.1" }, "scripts": { "test": "phpunit" diff --git a/composer.lock b/composer.lock index 9230bb4db9..16b9e50b52 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9f0dbeccbae197460a0ce74a940177cd", + "content-hash": "ee7a6d8a1a9df21b46478dd91c1b73b7", "packages": [ { "name": "asika/simple-console", @@ -2059,6 +2059,54 @@ ], "time": "2016-01-20T08:20:44+00:00" }, + { + "name": "johnkary/phpunit-speedtrap", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/johnkary/phpunit-speedtrap.git", + "reference": "f7cfe17c5a7076ed0ccca5450fe3bb981ec56361" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/johnkary/phpunit-speedtrap/zipball/f7cfe17c5a7076ed0ccca5450fe3bb981ec56361", + "reference": "f7cfe17c5a7076ed0ccca5450fe3bb981ec56361", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "phpunit/phpunit": ">=4.7,<6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-0": { + "JohnKary": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Kary", + "email": "john@johnkary.net" + } + ], + "description": "Find slow tests in your PHPUnit test suite", + "homepage": "https://github.com/johnkary/phpunit-speedtrap", + "keywords": [ + "phpunit", + "profile", + "slow" + ], + "time": "2017-03-25T17:14:26+00:00" + }, { "name": "mikey179/vfsStream", "version": "v1.6.5", From 644e152dca9886e8528a994d6b09f9e8069cfc4d Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Fri, 9 Nov 2018 20:14:10 +0100 Subject: [PATCH 02/17] friendica-6101 slow travis-ci tests --- phpunit.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index 9ed293b631..0209ce6aa2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -26,4 +26,7 @@ + + + From 7aae40ae6ac18abc19f4f6fe4174beff68dd93a2 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Fri, 9 Nov 2018 20:39:47 +0100 Subject: [PATCH 03/17] skipping TTL tests --- tests/src/Core/Cache/CacheTest.php | 2 ++ tests/src/Core/Lock/LockTest.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/src/Core/Cache/CacheTest.php b/tests/src/Core/Cache/CacheTest.php index 86bf5e7f01..e51ce745f0 100644 --- a/tests/src/Core/Cache/CacheTest.php +++ b/tests/src/Core/Cache/CacheTest.php @@ -123,6 +123,8 @@ abstract class CacheTest extends DatabaseTest * @medium */ function testTTL() { + $this->markTestSkipped('taking too much time without mocking'); + $this->assertNull($this->instance->get('value1')); $value = 'foobar'; diff --git a/tests/src/Core/Lock/LockTest.php b/tests/src/Core/Lock/LockTest.php index a7bbea265f..78f2271e54 100644 --- a/tests/src/Core/Lock/LockTest.php +++ b/tests/src/Core/Lock/LockTest.php @@ -116,6 +116,8 @@ abstract class LockTest extends DatabaseTest * @medium */ function testLockTTL() { + $this->markTestSkipped('taking too much time without mocking'); + $this->assertFalse($this->instance->isLocked('foo')); $this->assertFalse($this->instance->isLocked('bar')); From 8703fe4032f91efa8649f0ad3f6436a2620b42dd Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:17:33 -0500 Subject: [PATCH 04/17] Accept data structure in Logger::devLog --- src/Core/Logger.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Core/Logger.php b/src/Core/Logger.php index c9253a83e9..f9cb8cde01 100644 --- a/src/Core/Logger.php +++ b/src/Core/Logger.php @@ -115,6 +115,10 @@ class Logger extends BaseObject $processId = $a->process_id; } + if (!is_string($msg)) { + $msg = var_export($msg, true); + } + $callers = debug_backtrace(); $logline = sprintf("%s@\t%s:\t%s:\t%s\t%s\t%s\n", DateTimeFormat::utcNow(), From aaae7b56dfa658eb04ae757caaff4e591a684f8c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:18:16 -0500 Subject: [PATCH 05/17] Replace obsolete Addon::callHooks call with Hook::callAll in Model\Contact --- src/Model/Contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 8e150b5065..1c90d0c815 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -8,13 +8,13 @@ use Friendica\BaseObject; use Friendica\Content\Pager; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; -use Friendica\Model\Profile; use Friendica\Network\Probe; use Friendica\Object\Image; use Friendica\Protocol\ActivityPub; @@ -1606,7 +1606,7 @@ class Contact extends BaseObject $arr = ['url' => $url, 'contact' => []]; - Addon::callHooks('follow', $arr); + Hook::callAll('follow', $arr); if (empty($arr)) { $result['message'] = L10n::t('The contact could not be added. Please check the relevant network credentials in your Settings -> Social Networks page.'); From 10a8be79430c5b3550fa6097171d9663320208f8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:22:47 -0500 Subject: [PATCH 06/17] Accept URLs with no trailing slash in Probe::uri --- src/Network/Probe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index d870e06f97..aa770b92ee 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -575,7 +575,7 @@ class Probe { $parts = parse_url($uri); - if (!empty($parts["scheme"]) && !empty($parts["host"]) && !empty($parts["path"])) { + if (!empty($parts["scheme"]) && !empty($parts["host"])) { $host = $parts["host"]; if (!empty($parts["port"])) { $host .= ':'.$parts["port"]; @@ -590,7 +590,7 @@ class Probe return []; } - $path_parts = explode("/", trim($parts["path"], "/")); + $path_parts = explode("/", trim(defaults($parts, 'path', ''), "/")); while (!$lrdd && (sizeof($path_parts) > 1)) { $host .= "/".array_shift($path_parts); From 94a71d9ffc3e0294e01be07a55183ae8a9986406 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:23:11 -0500 Subject: [PATCH 07/17] Honor preference order in webfinger links --- src/Network/Probe.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index aa770b92ee..16ae0eff1d 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -979,7 +979,9 @@ class Probe { $hcard_url = ""; $data = []; - foreach ($webfinger["links"] as $link) { + // The array is reversed to take into account the order of preference for same-rel links + // See: https://tools.ietf.org/html/rfc7033#section-4.4.4 + foreach (array_reverse($webfinger["links"]) as $link) { if (($link["rel"] == NAMESPACE_DFRN) && !empty($link["href"])) { $data["network"] = Protocol::DFRN; } elseif (($link["rel"] == NAMESPACE_FEED) && !empty($link["href"])) { @@ -1182,7 +1184,9 @@ class Probe { $hcard_url = ""; $data = []; - foreach ($webfinger["links"] as $link) { + // The array is reversed to take into account the order of preference for same-rel links + // See: https://tools.ietf.org/html/rfc7033#section-4.4.4 + foreach (array_reverse($webfinger["links"]) as $link) { if (($link["rel"] == "http://microformats.org/profile/hcard") && !empty($link["href"])) { $hcard_url = $link["href"]; } elseif (($link["rel"] == "http://joindiaspora.com/seed_location") && !empty($link["href"])) { @@ -1283,7 +1287,9 @@ class Probe $pubkey = ""; if (is_array($webfinger["links"])) { - foreach ($webfinger["links"] as $link) { + // The array is reversed to take into account the order of preference for same-rel links + // See: https://tools.ietf.org/html/rfc7033#section-4.4.4 + foreach (array_reverse($webfinger["links"]) as $link) { if (($link["rel"] == "http://webfinger.net/rel/profile-page") && (defaults($link, "type", "") == "text/html") && ($link["href"] != "") @@ -1447,7 +1453,9 @@ class Probe private static function pumpio($webfinger, $addr) { $data = []; - foreach ($webfinger["links"] as $link) { + // The array is reversed to take into account the order of preference for same-rel links + // See: https://tools.ietf.org/html/rfc7033#section-4.4.4 + foreach (array_reverse($webfinger["links"]) as $link) { if (($link["rel"] == "http://webfinger.net/rel/profile-page") && (defaults($link, "type", "") == "text/html") && ($link["href"] != "") From a6a3c268bb399f52f0c091659ebdfc31a62b832d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:24:10 -0500 Subject: [PATCH 08/17] Use atom:author/atom:uri as profile-link in Feed::import - Use atom:author/atom:id as profile-id --- src/Protocol/Feed.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 71ebe5506b..d63b57b8c9 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -123,7 +123,13 @@ class Feed { $author["author-name"] = $value; } if ($simulate) { - $author["author-id"] = XML::getFirstNodeValue($xpath, '/atom:feed/atom:author/atom:uri/text()'); + $author["author-id"] = XML::getFirstNodeValue($xpath, '/atom:feed/atom:author/atom:id/text()'); + + // See https://tools.ietf.org/html/rfc4287#section-3.2.2 + $value = XML::getFirstNodeValue($xpath, 'atom:author/atom:uri/text()'); + if ($value != "") { + $author["author-link"] = $value; + } $value = XML::getFirstNodeValue($xpath, 'atom:author/poco:preferredUsername/text()'); if ($value != "") { From 7242b706f0c77847f95e3a0fd01fb6b6efffba7a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:24:31 -0500 Subject: [PATCH 09/17] Improve return path in mod/follow --- mod/follow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index 08f664d393..b92424c208 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -27,7 +27,7 @@ function follow_post(App $a) $uid = local_user(); $url = Strings::escapeTags(trim($_REQUEST['url'])); - $return_path = 'contacts'; + $return_path = 'follow?url=' . urlencode($url); // Makes the connection request for friendica contacts easier // This is just a precaution if maybe this page is called somewhere directly via POST From 1892462920f947f921322eb1f2a4cf1999ab1f00 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:24:53 -0500 Subject: [PATCH 10/17] Fix formatting in Probe::uri --- src/Network/Probe.php | 116 ++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 16ae0eff1d..9c57d624f8 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -318,10 +318,10 @@ class Probe * * @return array uri data */ - public static function uri($uri, $network = "", $uid = -1, $cache = true) + public static function uri($uri, $network = '', $uid = -1, $cache = true) { if ($cache) { - $result = Cache::get("Probe::uri:".$network.":".$uri); + $result = Cache::get('Probe::uri:' . $network . ':' . $uri); if (!is_null($result)) { return $result; } @@ -343,28 +343,28 @@ class Probe $data = $ap_profile; } - if (!isset($data["url"])) { - $data["url"] = $uri; + if (!isset($data['url'])) { + $data['url'] = $uri; } - if (x($data, "photo")) { - $data["baseurl"] = Network::getUrlMatch(Strings::normaliseLink(defaults($data, "baseurl", "")), Strings::normaliseLink($data["photo"])); + if (x($data, 'photo')) { + $data['baseurl'] = Network::getUrlMatch(Strings::normaliseLink(defaults($data, 'baseurl', '')), Strings::normaliseLink($data['photo'])); } else { - $data["photo"] = System::baseUrl().'/images/person-300.jpg'; + $data['photo'] = System::baseUrl() . '/images/person-300.jpg'; } - if (empty($data["name"])) { - if (!empty($data["nick"])) { - $data["name"] = $data["nick"]; + if (empty($data['name'])) { + if (!empty($data['nick'])) { + $data['name'] = $data['nick']; } - if (!x($data, "name")) { - $data["name"] = $data["url"]; + if (!x($data, 'name')) { + $data['name'] = $data['url']; } } - if (empty($data["nick"])) { - $data["nick"] = strtolower($data["name"]); + if (empty($data['nick'])) { + $data['nick'] = strtolower($data['name']); if (strpos($data['nick'], ' ')) { $data['nick'] = trim(substr($data['nick'], 0, strpos($data['nick'], ' '))); @@ -372,42 +372,44 @@ class Probe } if (!empty(self::$baseurl)) { - $data["baseurl"] = self::$baseurl; + $data['baseurl'] = self::$baseurl; } - if (empty($data["network"])) { - $data["network"] = Protocol::PHANTOM; + if (empty($data['network'])) { + $data['network'] = Protocol::PHANTOM; } $data = self::rearrangeData($data); // Only store into the cache if the value seems to be valid if (!in_array($data['network'], [Protocol::PHANTOM, Protocol::MAIL])) { - Cache::set("Probe::uri:".$network.":".$uri, $data, Cache::DAY); + Cache::set('Probe::uri:' . $network . ':' . $uri, $data, Cache::DAY); /// @todo temporary fix - we need a real contact update function that updates only changing fields /// The biggest problem is the avatar picture that could have a reduced image size. /// It should only be updated if the existing picture isn't existing anymore. /// We only update the contact when it is no probing for a specific network. if (($data['network'] != Protocol::FEED) - && ($network == "") - && $data["name"] - && $data["nick"] - && $data["url"] - && $data["addr"] - && $data["poll"] + && ($network == '') + && $data['name'] + && $data['nick'] + && $data['url'] + && $data['addr'] + && $data['poll'] ) { - $fields = ['name' => $data['name'], - 'nick' => $data['nick'], - 'url' => $data['url'], - 'addr' => $data['addr'], - 'photo' => $data['photo'], - 'keywords' => $data['keywords'], - 'location' => $data['location'], - 'about' => $data['about'], - 'notify' => $data['notify'], - 'network' => $data['network'], - 'server_url' => $data['baseurl']]; + $fields = [ + 'name' => $data['name'], + 'nick' => $data['nick'], + 'url' => $data['url'], + 'addr' => $data['addr'], + 'photo' => $data['photo'], + 'keywords' => $data['keywords'], + 'location' => $data['location'], + 'about' => $data['about'], + 'notify' => $data['notify'], + 'network' => $data['network'], + 'server_url' => $data['baseurl'] + ]; // This doesn't cover the case when a community isn't a community anymore if (!empty($data['community']) && $data['community']) { @@ -427,7 +429,7 @@ class Probe $fields['updated'] = DateTimeFormat::utcNow(); - $condition = ['nurl' => Strings::normaliseLink($data["url"])]; + $condition = ['nurl' => Strings::normaliseLink($data['url'])]; $old_fields = DBA::selectFirst('gcontact', $fieldnames, $condition); @@ -444,25 +446,27 @@ class Probe DBA::update('gcontact', $fields, $condition, $old_fields); - $fields = ['name' => $data['name'], - 'nick' => $data['nick'], - 'url' => $data['url'], - 'addr' => $data['addr'], - 'alias' => $data['alias'], - 'keywords' => $data['keywords'], - 'location' => $data['location'], - 'about' => $data['about'], - 'batch' => $data['batch'], - 'notify' => $data['notify'], - 'poll' => $data['poll'], - 'request' => $data['request'], - 'confirm' => $data['confirm'], - 'poco' => $data['poco'], - 'network' => $data['network'], - 'pubkey' => $data['pubkey'], - 'priority' => $data['priority'], - 'writable' => true, - 'rel' => Contact::SHARING]; + $fields = [ + 'name' => $data['name'], + 'nick' => $data['nick'], + 'url' => $data['url'], + 'addr' => $data['addr'], + 'alias' => $data['alias'], + 'keywords' => $data['keywords'], + 'location' => $data['location'], + 'about' => $data['about'], + 'batch' => $data['batch'], + 'notify' => $data['notify'], + 'poll' => $data['poll'], + 'request' => $data['request'], + 'confirm' => $data['confirm'], + 'poco' => $data['poco'], + 'network' => $data['network'], + 'pubkey' => $data['pubkey'], + 'priority' => $data['priority'], + 'writable' => true, + 'rel' => Contact::SHARING + ]; $fieldnames = []; @@ -474,7 +478,7 @@ class Probe } } - $condition = ['nurl' => Strings::normaliseLink($data["url"]), 'self' => false, 'uid' => 0]; + $condition = ['nurl' => Strings::normaliseLink($data['url']), 'self' => false, 'uid' => 0]; // "$old_fields" will return a "false" when the contact doesn't exist. // This won't trigger an insert. This is intended, since we only need From 09c94dba86db9120026415ff3226ad939459e07b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 10 Nov 2018 08:55:48 -0500 Subject: [PATCH 11/17] Add URL encoding to toggle_mobile parameter --- src/App.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index 12f302f06e..4451013093 100644 --- a/src/App.php +++ b/src/App.php @@ -787,9 +787,9 @@ class App */ if ($this->is_mobile || $this->is_tablet) { if (isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { - $link = 'toggle_mobile?address=' . curPageURL(); + $link = 'toggle_mobile?address=' . urlencode(curPageURL()); } else { - $link = 'toggle_mobile?off=1&address=' . curPageURL(); + $link = 'toggle_mobile?off=1&address=' . urlencode(curPageURL()); } $this->page['footer'] .= Core\Renderer::replaceMacros(Core\Renderer::getMarkupTemplate("toggle_mobile_footer.tpl"), [ '$toggle_link' => $link, From e30d7cfc036c354ee1b6255db287db1c9762b522 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Nov 2018 15:15:46 +0000 Subject: [PATCH 12/17] Add some hook to check if hook should be forked --- src/Core/Hook.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Core/Hook.php b/src/Core/Hook.php index a0200a7db3..d221933dae 100644 --- a/src/Core/Hook.php +++ b/src/Core/Hook.php @@ -7,6 +7,7 @@ namespace Friendica\Core; use Friendica\App; use Friendica\BaseObject; use Friendica\Database\DBA; +use Friendica\Core\Logger; /** * Some functions to handle hooks @@ -136,6 +137,22 @@ class Hook extends BaseObject { if (array_key_exists($name, self::$hooks)) { foreach (self::$hooks[$name] as $hook) { + // Call a hook to check if this hook call needs to be forked + $hookdata = ['name' => $name, 'data' => $data, 'execute' => true]; + + if (array_key_exists('hook_fork', self::$hooks)) { + foreach (self::$hooks['hook_fork'] as $fork_hook) { + if ($hook[0] != $fork_hook[0]) { + continue; + } + self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata); + } + } + + if (!$hookdata['execute']) { + continue; + } + Worker::add($priority, 'ForkHook', $name, $hook, $data); } } From 4a59a7ae7f257e7b12b43157622b71c9c8888347 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Nov 2018 15:16:48 +0000 Subject: [PATCH 13/17] Logger is not needed anymore --- src/Core/Hook.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Core/Hook.php b/src/Core/Hook.php index d221933dae..73aa95ee90 100644 --- a/src/Core/Hook.php +++ b/src/Core/Hook.php @@ -7,7 +7,6 @@ namespace Friendica\Core; use Friendica\App; use Friendica\BaseObject; use Friendica\Database\DBA; -use Friendica\Core\Logger; /** * Some functions to handle hooks From 033bf65f2c9c271fb81bccd2c1f259c56a630516 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Nov 2018 15:20:23 +0000 Subject: [PATCH 14/17] Some redesign --- src/Core/Hook.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Hook.php b/src/Core/Hook.php index 73aa95ee90..2d6c945067 100644 --- a/src/Core/Hook.php +++ b/src/Core/Hook.php @@ -137,19 +137,19 @@ class Hook extends BaseObject if (array_key_exists($name, self::$hooks)) { foreach (self::$hooks[$name] as $hook) { // Call a hook to check if this hook call needs to be forked - $hookdata = ['name' => $name, 'data' => $data, 'execute' => true]; - if (array_key_exists('hook_fork', self::$hooks)) { + $hookdata = ['name' => $name, 'data' => $data, 'execute' => true]; + foreach (self::$hooks['hook_fork'] as $fork_hook) { if ($hook[0] != $fork_hook[0]) { continue; } self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata); } - } - if (!$hookdata['execute']) { - continue; + if (!$hookdata['execute']) { + continue; + } } Worker::add($priority, 'ForkHook', $name, $hook, $data); From 3d8a343ab2f6c40187064e29696a678054df2f7e Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Nov 2018 16:55:12 +0000 Subject: [PATCH 15/17] Added documentation --- doc/Addons.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Addons.md b/doc/Addons.md index 50febf7214..bf139aea7f 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -693,6 +693,9 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- Addon::callHooks('logged_in', $a->user); +### src/Core/Hook.php + + self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata); ### src/Core/Worker.php From 8844bb690d08560f5e28c6a277dfc7d3fe8d3e93 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Nov 2018 23:56:11 +0000 Subject: [PATCH 16/17] Issue 6100: The AS object should be fetchable for every original post --- src/Module/Objects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Objects.php b/src/Module/Objects.php index d51d5785a5..e6dfb6a28e 100644 --- a/src/Module/Objects.php +++ b/src/Module/Objects.php @@ -27,7 +27,7 @@ class Objects extends BaseModule $a->internalRedirect(str_replace('objects/', 'display/', $a->query_string)); } - $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]); + $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]); if (!DBA::isResult($item)) { System::httpExit(404); } From de759e41c5907274f3e55af4d8ef4d499afd3754 Mon Sep 17 00:00:00 2001 From: Steffen K9 Date: Sun, 11 Nov 2018 01:14:50 +0100 Subject: [PATCH 17/17] Missing use for Strings In line 72 'Strings::' is used but the 'use Friendica\Util\Strings' was missing. --- mod/removeme.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/removeme.php b/mod/removeme.php index 44671ef073..49b8f6d534 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -10,6 +10,7 @@ use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\User; +use Friendica\Util\Strings; require_once 'include/enotify.php';