]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Merge branch 'master' into develop
[friendica.git] / src / Model / Item.php
index 0bac3210d716beea256833cae90b616a614134f1..e6ce67590e91a50d71c053254a2817d86fc1f4ff 100644 (file)
@@ -1122,8 +1122,9 @@ class Item extends BaseObject
                }
 
                // Is this a shadow entry?
-               if ($item['uid'] == 0)
+               if ($item['uid'] == 0) {
                        return;
+               }
 
                // Is there a shadow parent?
                if (!dba::exists('item', ['uri' => $item['parent-uri'], 'uid' => 0])) {
@@ -1163,10 +1164,8 @@ class Item extends BaseObject
 
                // If this was a comment to a Diaspora post we don't get our comment back.
                // This means that we have to distribute the comment by ourselves.
-               if ($origin) {
-                       if (dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
-                               self::distribute($public_shadow);
-                       }
+               if ($origin && dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
+                       self::distribute($public_shadow);
                }
        }
 
@@ -1177,14 +1176,14 @@ class Item extends BaseObject
         */
        private static function addLanguageInPostopts(&$item)
        {
+               $postopts = "";
+
                if (!empty($item['postopts'])) {
                        if (strstr($item['postopts'], 'lang=')) {
                                // do not override
                                return;
                        }
                        $postopts = $item['postopts'];
-               } else {
-                       $postopts = "";
                }
 
                $naked_body = Text\BBCode::toPlaintext($item['body'], false);