]> git.mxchange.org Git - friendica.git/blobdiff - include/NotificationsManager.php
Degrade priority step by step
[friendica.git] / include / NotificationsManager.php
index 96af0b76c20a9476aac3f43fd929759b404cd438..57c315c9d741954b671aff04560cadbc52202e63 100644 (file)
@@ -512,7 +512,7 @@ class NotificationsManager {
                $myurl = substr($myurl,strpos($myurl,'://')+3);
                $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
                $diasp_url = str_replace('/profile/','/u/',$myurl);
-               $sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' or `item`.`tag` regexp '%s' or `item`.`tag` regexp '%s' ) ",
+               $sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' OR `item`.`tag` regexp '%s' OR `item`.`tag` regexp '%s' ) ",
                        dbesc($myurl . '$'),
                        dbesc($myurl . '\\]'),
                        dbesc($diasp_url . '\\]')
@@ -829,11 +829,11 @@ class NotificationsManager {
        }
 
        /**
-        * @brief Check for missing contact data and try to fetch the data from 
+        * @brief Check for missing contact data and try to fetch the data from
         *     from other sources
-        * 
+        *
         * @param array $arr The input array with the intro data
-        * 
+        *
         * @return array The array with the intro data
         */
        private function getMissingIntroData($arr) {
@@ -850,13 +850,13 @@ class NotificationsManager {
                // get the missing data data from other sources
                if ($arr['gnetwork'] == "" || $arr['gaddr'] == "") {
                        $ret = get_contact_details_by_url($arr['url']);
-               }
 
-               if ($arr['gnetwork'] == "") {
-                       $arr['gnetwork'] = $ret['network'];
-               }
-               if ($arr['gaddr'] == "") {
-                       $arr['gaddr'] = $ret['addr'];
+                       if ($arr['gnetwork'] == "" && $ret['network'] != "") {
+                               $arr['gnetwork'] = $ret['network'];
+                       }
+                       if ($arr['gaddr'] == "" && $ret['addr'] != "") {
+                               $arr['gaddr'] = $ret['addr'];
+                       }
                }
 
                return $arr;