]> git.mxchange.org Git - friendica.git/commitdiff
added curely braces + TODO for maybe avoiding multi-lined if() blocks as it confuses...
authorRoland Haeder <roland@mxchange.org>
Thu, 23 Mar 2017 21:51:52 +0000 (22:51 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 23 Mar 2017 21:53:03 +0000 (22:53 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
include/dfrn.php
include/ostatus.php

index 1e1b82e39b03d47d4a361fcf8c99ee6e1a59b84b..34cd33c339bf58b55a9766349a9a8b9b4ed576b9 100644 (file)
@@ -2159,8 +2159,8 @@ class dfrn {
                                        $title = $attributes->textContent;
                                }
                        }
-                       if (($rel != "") AND ($href != ""))
-                               switch($rel) {
+                       if (($rel != "") AND ($href != "")) {
+                               switch ($rel) {
                                        case "alternate":
                                                $item["plink"] = $href;
                                                break;
@@ -2170,9 +2170,10 @@ class dfrn {
                                                        $item["attach"] .= ",";
                                                }
 
-                                               $item["attach"] .= '[attach]href="'.$href.'" length="'.$length.'" type="'.$type.'" title="'.$title.'"[/attach]';
+                                               $item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '" title="' . $title . '"[/attach]';
                                                break;
                                }
+                       }
                }
        }
 
index 2c4b677a53af99bf5316cc9ca8caa8a512ac5802..6061ef9e11847ba3117d2f9205695f4ba5715aec 100644 (file)
@@ -411,43 +411,51 @@ class ostatus {
                                                if ($attributes->name == "title")
                                                        $title = $attributes->textContent;
                                        }
-                                       if (($rel != "") AND ($href != ""))
-                                               switch($rel) {
+                                       if (($rel != "") AND ($href != "")) {
+                                               switch ($rel) {
                                                        case "alternate":
                                                                $item["plink"] = $href;
+                                                               /// @TODO These multi-lines can confuse, let's avoid them
                                                                if (($item["object-type"] == ACTIVITY_OBJ_QUESTION) OR
-                                                                       ($item["object-type"] == ACTIVITY_OBJ_EVENT))
+                                                                       ($item["object-type"] == ACTIVITY_OBJ_EVENT)) {
                                                                        $item["body"] .= add_page_info($href);
+                                                               }
                                                                break;
                                                        case "ostatus:conversation":
                                                                $conversation = $href;
                                                                break;
                                                        case "enclosure":
                                                                $enclosure = $href;
-                                                               if(strlen($item["attach"]))
+                                                               if (strlen($item["attach"])) {
                                                                        $item["attach"] .= ',';
+                                                               }
 
-                                                               $item["attach"] .= '[attach]href="'.$href.'" length="'.$length.'" type="'.$type.'" title="'.$title.'"[/attach]';
+                                                               $item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '" title="' . $title . '"[/attach]';
                                                                break;
                                                        case "related":
                                                                if ($item["object-type"] != ACTIVITY_OBJ_BOOKMARK) {
-                                                                       if (!isset($item["parent-uri"]))
+                                                                       if (!isset($item["parent-uri"])) {
                                                                                $item["parent-uri"] = $href;
+                                                                       }
 
-                                                                       if ($related == "")
+                                                                       if ($related == "") {
                                                                                $related = $href;
-                                                               } else
+                                                                       }
+                                                               } else {
                                                                        $item["body"] .= add_page_info($href);
+                                                               }
                                                                break;
                                                        case "self":
                                                                $self = $href;
                                                                break;
                                                        case "mentioned":
                                                                // Notification check
-                                                               if ($importer["nurl"] == normalise_link($href))
+                                                               if ($importer["nurl"] == normalise_link($href)) {
                                                                        $mention = true;
+                                                               }
                                                                break;
                                                }
+                                       }
                                }
                        }