]> git.mxchange.org Git - friendica.git/commitdiff
Remove deprecated App::removeBaseURL - process methods to DI::baseUrl()->remove()
authornupplaPhil <admin@philipp.info>
Sun, 15 Dec 2019 23:36:31 +0000 (00:36 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 29 Dec 2019 19:17:45 +0000 (20:17 +0100)
mod/display.php
mod/profiles.php
src/App.php
src/Content/Nav.php
src/Core/System.php
src/Model/Item.php
src/Module/Item/Compose.php
src/Object/Post.php
view/theme/frio/theme.php
view/theme/vier/theme.php

index de46cce0cb48f0e256ebd8681516f6fbb3f7c255..0d082f5982c11a42518dd92341adbf7f2cb8a021 100644 (file)
@@ -16,6 +16,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Item;
@@ -326,7 +327,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
        $title = trim(HTML::toPlaintext(BBCode::convert($item["title"], false), 0, true));
        $author_name = $item["author-name"];
 
-       $image = $a->removeBaseURL($item["author-avatar"]);
+       $image = DI::baseUrl()->remove($item["author-avatar"]);
 
        if ($title == "") {
                $title = $author_name;
index e298df668c572f6977c4695139484aecabc24e48..18fe636d3d5ee229e553cd2f939c88e0937ef0e5 100644 (file)
@@ -655,7 +655,7 @@ function profiles_content(App $a) {
                        $profiles = '';
                        foreach ($r as $rr) {
                                $profiles .= Renderer::replaceMacros($tpl, [
-                                       '$photo'        => $a->removeBaseURL($rr['thumb']),
+                                       '$photo'        => DI::baseUrl()->remove($rr['thumb']),
                                        '$id'           => $rr['id'],
                                        '$alt'          => L10n::t('Profile Image'),
                                        '$profile_name' => $rr['profile-name'],
index e213b741a3f3fa85bdb0d26033e705a269171461..d04c6f32359c074af18a9d02c828f20fc042e302 100644 (file)
@@ -323,21 +323,6 @@ class App
                return $this->baseURL->getUrlPath();
        }
 
-       /**
-        * @brief      Removes the base url from an url. This avoids some mixed content problems.
-        *
-        * @param string $origURL
-        *
-        * @return string The cleaned url
-        *
-        * @deprecated 2019.09 - Use BaseURL->remove() instead
-        * @see        BaseURL::remove()
-        */
-       public function removeBaseURL(string $origURL)
-       {
-               return $this->baseURL->remove($origURL);
-       }
-
        /**
         * Returns the current UserAgent as a String
         *
index ff1680ab3f0a52445ff8a8444fa339dc78d74093..6fca7beb91e2bc8ba71b0e9c8c6c507bd7361da1 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Profile;
 use Friendica\Model\User;
 
@@ -167,7 +168,7 @@ class Nav
                        // user info
                        $contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
                        $userinfo = [
-                               'icon' => (DBA::isResult($contact) ? $a->removeBaseURL($contact['micro']) : 'images/person-48.jpg'),
+                               'icon' => (DBA::isResult($contact) ? DI::baseUrl()->remove($contact['micro']) : 'images/person-48.jpg'),
                                'name' => $a->user['username'],
                        ];
                }
index 367e055c9309fe28a43b2cd1544d0b3b7505201f..426eb0a53dc42120693b867472d0ee43080b5269 100644 (file)
@@ -41,7 +41,7 @@ class System
         */
        public static function removedBaseUrl(string $orig_url)
        {
-               return DI::app()->removeBaseURL($orig_url);
+               return DI::baseUrl()->remove($orig_url);
        }
 
        /**
index f955337179d74f1171c2cdea074633665f6172e9..3f3de8f8f1f405e11a497508c3da3b3232dd567e 100644 (file)
@@ -3655,7 +3655,7 @@ class Item
                        ];
 
                        if (!empty($item['plink'])) {
-                               $ret["href"] = $a->removeBaseURL($item['plink']);
+                               $ret["href"] = DI::baseUrl()->remove($item['plink']);
                                $ret["title"] = L10n::t('link to source');
                        }
 
index 7a26c93cf05c68e8bccccdc1c4d14ed5016b9f6d..5d4a3c18edfb0f145e49e1d6a90672dba9a646e8 100644 (file)
@@ -127,9 +127,9 @@ class Compose extends BaseModule
                        '$type'         => $type,
                        '$wall'         => $wall,
                        '$default'      => '',
-                       '$mylink'       => $a->removeBaseURL($a->contact['url']),
+                       '$mylink'       => DI::baseUrl()->remove($a->contact['url']),
                        '$mytitle'      => L10n::t('This is you'),
-                       '$myphoto'      => $a->removeBaseURL($a->contact['thumb']),
+                       '$myphoto'      => DI::baseUrl()->remove($a->contact['thumb']),
                        '$submit'       => L10n::t('Submit'),
                        '$edbold'       => L10n::t('Bold'),
                        '$editalic'     => L10n::t('Italic'),
index e5a66a562fbae24db03ce60e67d1779a8fc27fa6..38ef12274803edcc3289e0d143b33ba3e3334324 100644 (file)
@@ -409,7 +409,7 @@ class Post
                        'profile_url'     => $profile_link,
                        'item_photo_menu' => item_photo_menu($item),
                        'name'            => $name_e,
-                       'thumb'           => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
+                       'thumb'           => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
                        'osparkle'        => $osparkle,
                        'sparkle'         => $sparkle,
                        'title'           => $title_e,
@@ -423,7 +423,7 @@ class Post
                        'shiny'           => $shiny,
                        'owner_self'      => $item['author-link'] == Session::get('my_url'),
                        'owner_url'       => $this->getOwnerUrl(),
-                       'owner_photo'     => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
+                       'owner_photo'     => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
                        'owner_name'      => $owner_name_e,
                        'plink'           => Item::getPlink($item),
                        'edpost'          => $edpost,
@@ -899,9 +899,9 @@ class Post
                                '$qcomment'    => $qcomment,
                                '$default'     => $default_text,
                                '$profile_uid' => $uid,
-                               '$mylink'      => $a->removeBaseURL($a->contact['url']),
+                               '$mylink'      => DI::baseUrl()->remove($a->contact['url']),
                                '$mytitle'     => L10n::t('This is you'),
-                               '$myphoto'     => $a->removeBaseURL($a->contact['thumb']),
+                               '$myphoto'     => DI::baseUrl()->remove($a->contact['thumb']),
                                '$comment'     => L10n::t('Comment'),
                                '$submit'      => L10n::t('Submit'),
                                '$edbold'      => L10n::t('Bold'),
index 5995f54374171f4b2e701e31a8b96f182f22f621..1e255e38b042e917aed2c7c0cfe1d23a03eb692b 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module;
 use Friendica\Util\Strings;
@@ -239,7 +240,7 @@ function frio_remote_nav($a, &$nav)
                // user info
                $r = q("SELECT `micro` FROM `contact` WHERE `uid` = %d AND `self`", intval($a->user['uid']));
 
-               $r[0]['photo'] = (DBA::isResult($r) ? $a->removeBaseURL($r[0]['micro']) : 'images/person-48.jpg');
+               $r[0]['photo'] = (DBA::isResult($r) ? DI::baseUrl()->remove($r[0]['micro']) : 'images/person-48.jpg');
                $r[0]['name'] = $a->user['username'];
        } elseif (!local_user() && remote_user()) {
                $r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
index e5d71bdf578545b13157a9f926f8c79de81b6a06..2ffa957fe0016e54747b63b2ee0333757344912a 100644 (file)
@@ -18,6 +18,7 @@ use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Util\Proxy as ProxyUtils;
@@ -163,7 +164,7 @@ function vier_community_info()
                                $entry = Renderer::replaceMacros($tpl, [
                                        '$id' => $rr['id'],
                                        '$profile_link' => $profile_link,
-                                       '$photo' => $a->removeBaseURL($rr['thumb']),
+                                       '$photo' => DI::baseUrl()->remove($rr['thumb']),
                                        '$alt_text' => $rr['name']]);
                                $aside['$lastusers_items'][] = $entry;
                        }