]> git.mxchange.org Git - friendica.git/blobdiff - mod/suggest.php
Fix fatal error because of unknown function "fetchUrl"
[friendica.git] / mod / suggest.php
index 77f75f8b8f3a816879cd9e9e8c071836e4ebe0e9..66d22b001ef40d8501c57175deac6ca08fa22b68 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 /**
- * @file mod/suggest.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;
@@ -35,7 +51,7 @@ function suggest_content(App $a)
        $o = '';
 
        if (! local_user()) {
-               notice(DI::l10n()->t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
@@ -88,7 +104,7 @@ function suggest_content(App $a)
                        'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
                ];
 
-               $contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
+               $contact_details = Contact::getByURLForUser($rr["url"], local_user()) ?: $rr;
 
                $entry = [
                        'url' => Contact::magicLink($rr['url']),