]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/GContact.php
Issue 6282: Update the forum status of contacts
[friendica.git] / src / Model / GContact.php
index 1fed1fc3ef5b8464f521814dc99b3976b17a9ec9..337a938a747c86fc2d307355753bd63e13a1ae55 100644 (file)
@@ -19,8 +19,6 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
 
-require_once 'include/dba.php';
-
 /**
  * @brief This class handles GlobalContact related functions
  */
@@ -520,7 +518,7 @@ class GContact
         */
        public static function updateSuggestions()
        {
-               $a = get_app();
+               $a = \get_app();
 
                $done = [];
 
@@ -864,7 +862,7 @@ class GContact
                                                'location' => $contact['location'], 'about' => $contact['about']];
 
                                // Don't update the birthday field if not set or invalid
-                               if (empty($contact['birthday']) || ($contact['birthday'] < '0001-01-01')) {
+                               if (empty($contact['birthday']) || ($contact['birthday'] <= DBA::NULL_DATE)) {
                                        unset($fields['bd']);
                                }
 
@@ -966,8 +964,8 @@ class GContact
 
                $statistics = json_decode($curlResult->getBody());
 
-               if (!empty($statistics->config)) {
-                       if ($statistics->config->instance_with_ssl) {
+               if (!empty($statistics->config->instance_address)) {
+                       if (!empty($statistics->config->instance_with_ssl)) {
                                $server = "https://";
                        } else {
                                $server = "http://";
@@ -976,8 +974,8 @@ class GContact
                        $server .= $statistics->config->instance_address;
 
                        $hostname = $statistics->config->instance_address;
-               } elseif (!empty($statistics)) {
-                       if ($statistics->instance_with_ssl) {
+               } elseif (!empty($statistics->instance_address)) {
+                       if (!empty($statistics->instance_with_ssl)) {
                                $server = "https://";
                        } else {
                                $server = "http://";