]> 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 Häder <roland@mxchange.org>
Mon, 14 May 2018 20:49:54 +0000 (22:49 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
include/security.php
include/text.php

index b13a507cf483c124e5e1de3ed3817b205784d3aa..70896992d94b4abfa24b4c79bfc9da1cf94ba76f 100644 (file)
@@ -299,8 +299,9 @@ function 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 4c9a8864d595d6dca9d10c9f221d5a9e4627542b..b59ecdbc0dc906ecf8105986f830c02b8637dde6 100644 (file)
@@ -1660,10 +1660,11 @@ function bb_translate_video($s) {
        $r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER);
        if ($r) {
                foreach ($matches as $mtch) {
-                       if ((stristr($mtch[1],'youtube')) || (stristr($mtch[1],'youtu.be')))
-                               $s = str_replace($mtch[0],'[youtube]' . $mtch[1] . '[/youtube]',$s);
-                       elseif (stristr($mtch[1],'vimeo'))
-                               $s = str_replace($mtch[0],'[vimeo]' . $mtch[1] . '[/vimeo]',$s);
+                       if ((stristr($mtch[1], 'youtube')) || (stristr($mtch[1], 'youtu.be'))) {
+                               $s = str_replace($mtch[0], '[youtube]' . $mtch[1] . '[/youtube]', $s);
+                       } elseif (stristr($mtch[1], 'vimeo')) {
+                               $s = str_replace($mtch[0], '[vimeo]' . $mtch[1] . '[/vimeo]', $s);
+                       }
                }
        }
        return $s;
@@ -1781,7 +1782,7 @@ function file_tag_file_query($table,$s,$type = 'file') {
 }
 
 // ex. given music,video return <music><video> or [music][video]
-function file_tag_list_to_file($list,$type = 'file') {
+function file_tag_list_to_file($list, $type = 'file') {
        $tag_list = '';
        if (strlen($list)) {
                $list_array = explode(",",$list);
@@ -1803,7 +1804,7 @@ function file_tag_list_to_file($list,$type = 'file') {
 }
 
 // ex. given <music><video>[friends], return music,video or friends
-function file_tag_file_to_list($file,$type = 'file') {
+function file_tag_file_to_list($file, $type = 'file') {
        $matches = false;
        $list = '';
        if ($type == 'file') {
@@ -1853,8 +1854,9 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
                $check_new_tags = explode(",",file_tag_file_to_list($file_new,$type));
 
                foreach ($check_new_tags as $tag) {
-                       if (! stristr($saved,$lbracket . file_tag_encode($tag) . $rbracket))
+                       if (! stristr($saved,$lbracket . file_tag_encode($tag) . $rbracket)) {
                                $new_tags[] = $tag;
+                       }
                }
 
                $filetags_updated .= file_tag_list_to_file(implode(",",$new_tags),$type);
@@ -1864,8 +1866,9 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
                $check_deleted_tags = explode(",",file_tag_file_to_list($file_old,$type));
 
                foreach ($check_deleted_tags as $tag) {
-                       if (! stristr($file_new,$lbracket . file_tag_encode($tag) . $rbracket))
+                       if (! stristr($file_new,$lbracket . file_tag_encode($tag) . $rbracket)) {
                                $deleted_tags[] = $tag;
+                       }
                }
 
                foreach ($deleted_tags as $key => $tag) {
@@ -1981,9 +1984,10 @@ function is_a_date_arg($s) {
        if ($i > 1900) {
                $y = date('Y');
                if ($i <= $y + 1 && strpos($s, '-') == 4) {
-                       $m = intval(substr($s,5));
+                       $m = intval(substr($s, 5));
                        if ($m > 0 && $m <= 12)
                                return true;
+                       }
                }
        }
        return false;
@@ -2003,6 +2007,7 @@ function deindent($text, $chr = "[\t ]", $count = NULL) {
                preg_match("|^" . $chr . "*|", $lines[$k], $m);
                $count = strlen($m[0]);
        }
+
        for ($k = 0; $k < count($lines); $k++) {
                $lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
        }