From a4a7f19df13b3a93f64f5414ac3fbd8c0c75a537 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Mon, 30 Dec 2019 23:02:20 +0100 Subject: [PATCH] Move redundant System::removedBaseUrl() to DI::baseUrl()->remove() calls --- include/conversation.php | 5 ++--- include/enotify.php | 2 +- mod/display.php | 3 +-- src/Content/ForumManager.php | 4 ++-- src/Content/Widget/TagCloud.php | 4 ++-- view/theme/vier/theme.php | 3 +-- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index cc191ef61..409d67907 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -16,7 +16,6 @@ use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Session; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -686,7 +685,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ 'name' => $profile_name, 'sparkle' => $sparkle, 'lock' => $lock, - 'thumb' => System::removedBaseUrl(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'thumb' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)), 'title' => $title, 'body' => $body, 'tags' => $tags['tags'], @@ -706,7 +705,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ 'indent' => '', 'owner_name' => $owner_name, 'owner_url' => $owner_url, - 'owner_photo' => System::removedBaseUrl(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'owner_photo' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)), 'plink' => Item::getPlink($item), 'edpost' => false, 'isstarred' => $isstarred, diff --git a/include/enotify.php b/include/enotify.php index cc465dc12..1ddc9372a 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -59,7 +59,7 @@ function notification($params) $banner = $l10n->t('Friendica Notification'); $product = FRIENDICA_PLATFORM; - $siteurl = DI::baseUrl(true); + $siteurl = DI::baseUrl()->get(true); $thanks = $l10n->t('Thank You,'); $sitename = Config::get('config', 'sitename'); if (Config::get('config', 'admin_name')) { diff --git a/mod/display.php b/mod/display.php index 83e3f63ba..d5db5d7e9 100644 --- a/mod/display.php +++ b/mod/display.php @@ -13,7 +13,6 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; @@ -158,7 +157,7 @@ function display_fetchauthor($a, $item) $profiledata = Contact::getDetailsByURL($profiledata["url"], local_user(), $profiledata); if (!empty($profiledata["photo"])) { - $profiledata["photo"] = System::removedBaseUrl($profiledata["photo"]); + $profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]); } return $profiledata; diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php index 1b2927316..6d1d330c3 100644 --- a/src/Content/ForumManager.php +++ b/src/Content/ForumManager.php @@ -9,8 +9,8 @@ use Friendica\Core\Protocol; use Friendica\Content\Text\HTML; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Util\Proxy as ProxyUtils; @@ -116,7 +116,7 @@ class ForumManager 'name' => $contact['name'], 'cid' => $contact['id'], 'selected' => $selected, - 'micro' => System::removedBaseUrl(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), + 'micro' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), 'id' => ++$id, ]; $entries[] = $entry; diff --git a/src/Content/Widget/TagCloud.php b/src/Content/Widget/TagCloud.php index bbf8c3885..15ed41a35 100644 --- a/src/Content/Widget/TagCloud.php +++ b/src/Content/Widget/TagCloud.php @@ -8,8 +8,8 @@ namespace Friendica\Content\Widget; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Item; /** @@ -38,7 +38,7 @@ class TagCloud $r = self::tagadelic($uid, $count, $owner_id, $flags, $type); if (count($r)) { $contact = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); - $url = System::removedBaseUrl($contact['url']); + $url = DI::baseUrl()->remove($contact['url']); $tags = []; foreach ($r as $rr) { diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index 7bba680fe..98e8b6807 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -16,7 +16,6 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -213,7 +212,7 @@ function vier_community_info() 'name' => $contact['name'], 'cid' => $contact['id'], 'selected' => $selected, - 'micro' => System::removedBaseUrl(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), + 'micro' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), 'id' => ++$id, ]; $entries[] = $entry;