From eaa7740da606872f57765f1744b32c6e1f1d28a9 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 6 Jun 2020 17:31:23 -0400 Subject: [PATCH] Remove superfluous code - Remove explicit default parameter value in BBCode::convertShareCallback - Remove Probe::$baseurl reset since the twitter probe sets the `baseurl` property - Remove baseurl guessing in Probe::detect --- src/Content/Text/BBCode.php | 2 +- src/Network/Probe.php | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index ae1af435c6..70c7eb92a9 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1076,7 +1076,7 @@ class BBCode default: $text = ($is_quote_share? "\n" : ''); - $authorId = Contact::getIdForURL($attributes['profile'], 0); + $authorId = Contact::getIdForURL($attributes['profile']); $contact = Contact::getById($authorId, ['network']); diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 241988dd53..19fc135d7b 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -781,13 +781,6 @@ class Probe Logger::log($uri." is ".$result["network"], Logger::DEBUG); - if (empty($result["baseurl"]) && ($result["network"] != Protocol::PHANTOM)) { - $pos = strpos($result["url"], $host); - if ($pos) { - $result["baseurl"] = substr($result["url"], 0, $pos).$host; - } - } - return $result; } @@ -1730,8 +1723,6 @@ class Probe */ private static function twitter($uri) { - self::$baseurl = ''; - if (preg_match('=(.*)@twitter.com=i', $uri, $matches)) { $nick = $matches[1]; } elseif (preg_match('=https?://twitter.com/(.*)=i', $uri, $matches)) {