]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Remove deprecated App::removeBaseURL - process methods to DI::baseUrl()->remove()
[friendica.git] / mod / display.php
index b388b915e17a9b79c359ee6a957fe605c9769baf..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;
@@ -172,6 +173,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
 
        $o = '';
 
+       $item = null;
+
        if ($update) {
                $item_id = $_REQUEST['item_id'];
                $item = Item::selectFirst(['uid', 'parent', 'parent-uri'], ['id' => $item_id]);
@@ -221,7 +224,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
                }
        }
 
-       if (!$item_id) {
+       if (empty($item)) {
                throw new HTTPException\NotFoundException(L10n::t('The requested item doesn\'t exist or has been deleted.'));
        }
 
@@ -324,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;