]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/NoScrape.php
Changes:
[friendica.git] / src / Module / NoScrape.php
index 718c95c107cc4de8b438a5c0cc2684313e73eb31..c4138ed709db5c2c0191a3bd2b3134993f4ffe3d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,7 +23,6 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Core\System;
-use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\APContact;
 use Friendica\Model\User;
@@ -46,13 +45,13 @@ class NoScrape extends BaseModule
                        // view infos about a known profile (needs a login)
                        $which = $a->getLoggedInUserNickname();
                } else {
-                       System::jsonError(403, 'Authentication required');
+                       $this->jsonError(403, 'Authentication required');
                }
 
                $owner = User::getOwnerDataByNick($which);
 
                if (empty($owner['uid'])) {
-                       System::jsonError(404, 'Profile not found');
+                       $this->jsonError(404, 'Profile not found');
                }
 
                $json_info = [
@@ -72,7 +71,7 @@ class NoScrape extends BaseModule
 
                if (!$owner['net-publish']) {
                        $json_info['hide'] = true;
-                       System::jsonExit($json_info);
+                       $this->jsonExit($json_info);
                }
 
                $keywords = $owner['pub_keywords'] ?? '';
@@ -95,7 +94,7 @@ class NoScrape extends BaseModule
 
                // We display the last activity (post or login), reduced to year and week number
                $last_active = strtotime($owner['last-item']);
-               if ($last_active < strtotime($owner['last-activity'])) {
+               if ($owner['last-activity'] && $last_active < strtotime($owner['last-activity'])) {
                        $last_active = strtotime($owner['last-activity']);
                }
                $json_info['last-activity'] = date('o-W', $last_active);
@@ -108,6 +107,6 @@ class NoScrape extends BaseModule
                        }
                }
 
-               System::jsonExit($json_info);
+               $this->jsonExit($json_info);
        }
 }