]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Merge pull request #8350 from nupplaphil/bug/8342_not_link
[friendica.git] / mod / display.php
index b5edafc5f93f84db4a20fa61125df4853ab229b3..dce8b25b9cd4fd2adc5350a6d56e4b870ba84673 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 /**
- * @file mod/display.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
@@ -96,13 +112,13 @@ function display_init(App $a)
 
        $profiledata = display_fetchauthor($a, $item);
 
-       if (strstr(Strings::normaliseLink($profiledata["url"]), Strings::normaliseLink(DI::baseUrl()))) {
-               $nickname = str_replace(Strings::normaliseLink(DI::baseUrl())."/profile/", "", Strings::normaliseLink($profiledata["url"]));
+       if (strstr(Strings::normaliseLink($profiledata['url']), Strings::normaliseLink(DI::baseUrl()))) {
+               $nickname = str_replace(Strings::normaliseLink(DI::baseUrl()) . '/profile/', '', Strings::normaliseLink($profiledata['url']));
 
-               if ($nickname != $a->user["nickname"]) {
+               if (!empty($a->user['nickname']) && $nickname != $a->user['nickname']) {
                        $profile = DBA::fetchFirst("SELECT `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
                                INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
-                               WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
+                               WHERE `user`.`nickname` = ? AND `contact`.`self` LIMIT 1",
                                $nickname
                        );
                        if (DBA::isResult($profile)) {
@@ -114,7 +130,7 @@ function display_init(App $a)
                }
        }
 
-       Profile::load($a, $nick, 0, $profiledata);
+       Profile::load($a, $nick, $profiledata);
 }
 
 function display_fetchauthor($a, $item)
@@ -315,7 +331,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
                $o .= "<script> var netargs = '?item_id=" . $item_id . "'; </script>";
        }
 
-       $o .= conversation($a, [$item], new Pager(DI::args()->getQueryString()), 'display', $update_uid, false, 'commented', $item_uid);
+       $o .= conversation($a, [$item], 'display', $update_uid, false, 'commented', $item_uid);
 
        // Preparing the meta header
        $description = trim(HTML::toPlaintext(BBCode::convert($item["body"], false), 0, true));