]> git.mxchange.org Git - friendica.git/commitdiff
added spaces + some curly braces
authorRoland Häder <roland@mxchange.org>
Thu, 26 Jan 2017 15:01:56 +0000 (16:01 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 18 Mar 2017 23:52:24 +0000 (00:52 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
include/contact_widgets.php
include/conversation.php
include/dfrn.php
include/ostatus.php
include/security.php
include/text.php

index 7a5fd6f5f627c2bbab496ddff11eb0832706e8e8..0f78d5bf5cb6781f635caa809ce859205352fc16 100644 (file)
@@ -172,10 +172,11 @@ function categories_widget($baseurl,$selected = '') {
 
        $matches = false;
        $terms = array();
-        $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
-        if ($cnt) {
-                foreach ($matches as $mtch) {
-                       $unescaped = xmlify(file_tag_decode($mtch[1]));
+       $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
+
+       if ($cnt) {
+               foreach ($matches as $mtch) {
+                       $unescaped = xmlify(file_tag_decode($mtch[1]));
                        $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
                }
        }
index d29b4345046c0e76afe102b1ee6a55e38ac20d23..d3e4c6e4ab89ddd9b0af8dd9901359bdd31851d3 100644 (file)
@@ -309,8 +309,9 @@ function localize_item(&$item){
        $matches = null;
        if (preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
                foreach ($matches as $mtch) {
-                       if (! strpos($mtch[1],'zrl='))
+                       if (! strpos($mtch[1],'zrl=')) {
                                $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
+                       }
                }
        }
 
@@ -1360,20 +1361,25 @@ function conv_sort($arr,$order) {
 
        $arr = $newarr;
 
-       foreach ($arr as $x)
-               if ($x['id'] == $x['parent'])
-                               $parents[] = $x;
+       foreach ($arr as $x) {
+               if ($x['id'] == $x['parent']) {
+                       $parents[] = $x;
+               }
+       }
 
-       if (stristr($order,'created'))
+       if (stristr($order,'created')) {
                usort($parents,'sort_thr_created');
-       elseif (stristr($order,'commented'))
+       } elseif (stristr($order,'commented')) {
                usort($parents,'sort_thr_commented');
+       }
 
-       if (count($parents))
-               foreach ($parents as $i=>$_x)
+       if (count($parents)) {
+               foreach($parents as $i=>$_x) {
                        $parents[$i]['children'] = get_item_children($arr, $_x);
+               }
+       }
 
-       /*foreach ($arr as $x) {
+       /*foreach($arr as $x) {
                if ($x['id'] != $x['parent']) {
                        $p = find_thread_parent_index($parents,$x);
                        if ($p !== false)
index 37df682a1be0aae779fcd4d5421bb7d63ac443b7..7d5020425b26380e37c9eb43b0b10be0f1468b63 100644 (file)
@@ -1277,7 +1277,7 @@ class dfrn {
                        $href = "";
                        $width = 0;
                        foreach ($avatar->attributes AS $attributes) {
-                               /// @TODO Rewrite these similar if() to one switch
+                               /// @TODO Rewrite these similar if () to one switch
                                if ($attributes->name == "href") {
                                        $href = $attributes->textContent;
                                }
@@ -2122,7 +2122,7 @@ class dfrn {
                $title = "";
                foreach ($links AS $link) {
                        foreach ($link->attributes AS $attributes) {
-                               /// @TODO Rewrite these repeated (same) if() statements to a switch()
+                               /// @TODO Rewrite these repeated (same) if () statements to a switch()
                                if ($attributes->name == "href") {
                                        $href = $attributes->textContent;
                                }
index 996fdbfd75488cce6e3dfc8dc894b72998bd836c..26be15a0201635eb24ef5758c34c6edebb5a7f53 100644 (file)
@@ -1138,7 +1138,7 @@ class ostatus {
                                continue;
                        }
 
-                       /// @TODO One statment is okay (until if() )
+                       /// @TODO One statment is okay (until if () )
                        $arr = array();
                        $arr["network"] = $details["network"];
                        $arr["uri"] = $single_conv->id;
index 6049700a387cc75d4f480996855727a169555add..63a6b9574f7d9cdc9f845725034460733354b7c3 100644 (file)
@@ -358,8 +358,9 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
                        $gs = '<<>>'; // should be impossible to match
 
                        if (is_array($groups) && count($groups)) {
-                               foreach ($groups as $g)
+                               foreach ($groups as $g) {
                                        $gs .= '|<' . intval($g) . '>';
+                               }
                        }
 
                        $sql = sprintf(
index 2f2f1b32018788c4ec6c9f1668f11443d273c60d..a02021e03c1c3793b953753780e2688da3a8ce4c 100644 (file)
@@ -421,8 +421,9 @@ function expand_acl($s) {
                $t = str_replace('<','',$s);
                $a = explode('>',$t);
                foreach ($a as $aa) {
-                       if (intval($aa))
+                       if (intval($aa)) {
                                $ret[] = intval($aa);
+                       }
                }
        }
        return $ret;