Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
created
core/factory/actionlist.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 return [
3 3
     '1'   => 'Loading a frame(set)', //ok
4 4
     '2'   => 'Viewing dashboard', //ok
5
-    '3'   => 'Viewing data for resource',  //ok
5
+    '3'   => 'Viewing data for resource', //ok
6 6
     '4'   => 'Creating a resource', //ok == 27, 72, 85, 4
7 7
     '5'   => 'Saving resource', //ok
8 8
     '6'   => 'Deleting resource', //ok
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     '30'  => 'Saving settings', //ok
33 33
     '31'  => 'Using file manager', //ok
34 34
     '32'  => 'Saving user', //ok
35
-    '33'  => 'Deleting user',//ok
35
+    '33'  => 'Deleting user', //ok
36 36
     '34'  => 'Saving new password', //ok
37
-    '35'  => 'Editing role',//ok == 38
37
+    '35'  => 'Editing role', //ok == 38
38 38
     '36'  => 'Saving role', //ok
39 39
     '37'  => 'Deleting role', //ok
40 40
     '38'  => 'Creating new role', //ok == 35
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     '66'  => 'Sending a message', //ok
68 68
     '67'  => 'Removing locks', //ok
69 69
     '68'  => 'Viewing site logging', //not found
70
-    '69'  => 'Viewing online visitors',//not found
70
+    '69'  => 'Viewing online visitors', //not found
71 71
     '70'  => 'Viewing site schedule', //ok
72 72
     '71'  => 'Searching', //ok
73 73
     '72'  => 'Adding a weblink', //ok  27, 72, 85, 4
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
     '85'  => 'Create Folder', //ok 27, 72, 85, 4
85 85
     '86'  => 'Role management', //ok
86 86
     '87'  => 'Create new web user', //ok 87, 88
87
-    '88'  => 'Editing web user',//ok 87, 88
87
+    '88'  => 'Editing web user', //ok 87, 88
88 88
     '89'  => 'Saving web user', //ok
89 89
     '90'  => 'Deleting web user', //ok
90 90
     '91'  => 'Editing Web Access Permissions', //ok
91
-    '92'  => 'Editing Access Permissions',  // ok access groups processor
91
+    '92'  => 'Editing Access Permissions', // ok access groups processor
92 92
     '93'  => 'Backup Manager', //ok
93 93
     '94'  => 'Duplicate resource', //ok
94 94
     '95'  => 'Importing resources from HTML', //ok
95 95
     '96'  => 'Duplicate Template', //ok
96
-    '97'  => 'Duplicate Chunk (HTML Snippet)',//ok
96
+    '97'  => 'Duplicate Chunk (HTML Snippet)', //ok
97 97
     '98'  => 'Duplicate Snippet', //ok
98 98
     '99'  => 'Manage Web Users', //ok
99 99
     '100' => 'Previewing resource', //ok change the plugin priority
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
     '110' => 'Delete module', //ok
110 110
     '111' => 'Duplicate module', //ok
111 111
     '112' => 'Execute module', //ok
112
-    '113' => 'Manage module dependencies',//ok
112
+    '113' => 'Manage module dependencies', //ok
113 113
     '114' => 'View event log', //ok
114 114
     '115' => 'View event log details', //ok
115 115
     '116' => 'Delete event log', //ok
116
-    '117' => 'Editing tv rank',  //ok
116
+    '117' => 'Editing tv rank', //ok
117 117
     '118' => 'Call settings ajax include', //ok
118
-    '119' => 'Login Fail (Temporary Block)',//ok  get the purge processor
118
+    '119' => 'Login Fail (Temporary Block)', //ok  get the purge processor
119 119
 
120 120
     '300' => 'Create Template Variable', //ok 300,301
121
-    '301' => 'Edit Template Variable',//ok 300,301
122
-    '302' => 'Save Template Variable',//ok
123
-    '303' => 'Delete Template Variable',//ok
124
-    '304' => 'Duplicate Template Variable',//ok
121
+    '301' => 'Edit Template Variable', //ok 300,301
122
+    '302' => 'Save Template Variable', //ok
123
+    '303' => 'Delete Template Variable', //ok
124
+    '304' => 'Duplicate Template Variable', //ok
125 125
 
126 126
     '200' => 'Viewing phpInfo()', //ok
127 127
     '501' => 'Delete category', //ok
Please login to merge, or discard this patch.
core/modifiers/mdf_getimage.inc.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 $pattern = '/<img[\s\n]+.*src=[\s\n]*"([^"]+\.(jpg|jpeg|png|gif))"[^>]+>/i';
3
-preg_match_all($pattern , $value , $images);
4
-if($opt==='')
3
+preg_match_all($pattern, $value, $images);
4
+if ($opt === '')
5 5
 {
6
-    if($images[1][0])  return $images[1][0];
6
+    if ($images[1][0])  return $images[1][0];
7 7
     else               return '';
8 8
 }
9 9
 else
10 10
 {
11
-    foreach($images[0] as $i=>$image)
11
+    foreach ($images[0] as $i=>$image)
12 12
     {
13
-        if(strpos($image,$opt)!==false) return $images[1][$i];
13
+        if (strpos($image, $opt) !== false) return $images[1][$i];
14 14
     }
15 15
 }
16 16
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 $pattern = '/<img[\s\n]+.*src=[\s\n]*"([^"]+\.(jpg|jpeg|png|gif))"[^>]+>/i';
3 3
 preg_match_all($pattern , $value , $images);
4
-if($opt==='')
5
-{
6
-    if($images[1][0])  return $images[1][0];
7
-    else               return '';
8
-}
9
-else
10
-{
11
-    foreach($images[0] as $i=>$image)
12
-    {
13
-        if(strpos($image,$opt)!==false) return $images[1][$i];
4
+if($opt==='') {
5
+    if($images[1][0]) {
6
+        return $images[1][0];
7
+    } else {
8
+        return '';
9
+    }
10
+    } else {
11
+    foreach($images[0] as $i=>$image) {
12
+        if(strpos($image,$opt)!==false) {
13
+            return $images[1][$i];
14
+        }
14 15
     }
15 16
 }
16 17
 
Please login to merge, or discard this patch.
core/modifiers/mdf_addbreak.inc.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 $text = $modx->getModifiers()->parseDocumentSource($value);
3
-$text = str_replace(array("\r\n","\r"),"\n",$text);
3
+$text = str_replace(array("\r\n", "\r"), "\n", $text);
4 4
 
5 5
 $blockElms  = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div';
6 6
 $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote';
7 7
 $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed';
8 8
 $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code';
9 9
 $blockElms = explode(',', $blockElms);
10
-$lines = explode("\n",$text);
10
+$lines = explode("\n", $text);
11 11
 $c = count($lines);
12
-foreach($lines as $i=>$line)
12
+foreach ($lines as $i=>$line)
13 13
 {
14 14
     $line = rtrim($line);
15
-    if($i===$c-1) break;
16
-    foreach($blockElms as $block)
15
+    if ($i === $c - 1) break;
16
+    foreach ($blockElms as $block)
17 17
     {
18
-        if(preg_match("@</?{$block}" . '[^>]*>$@',$line))
18
+        if (preg_match("@</?{$block}".'[^>]*>$@', $line))
19 19
             continue 2;
20 20
     }
21 21
     $lines[$i] = "{$line}<br />";
Please login to merge, or discard this patch.
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,14 +9,15 @@
 block discarded – undo
9 9
 $blockElms = explode(',', $blockElms);
10 10
 $lines = explode("\n",$text);
11 11
 $c = count($lines);
12
-foreach($lines as $i=>$line)
13
-{
12
+foreach($lines as $i=>$line) {
14 13
     $line = rtrim($line);
15
-    if($i===$c-1) break;
16
-    foreach($blockElms as $block)
17
-    {
18
-        if(preg_match("@</?{$block}" . '[^>]*>$@',$line))
19
-            continue 2;
14
+    if($i===$c-1) {
15
+        break;
16
+    }
17
+    foreach($blockElms as $block) {
18
+        if(preg_match("@</?{$block}" . '[^>]*>$@',$line)) {
19
+                    continue 2;
20
+        }
20 21
     }
21 22
     $lines[$i] = "{$line}<br />";
22 23
 }
Please login to merge, or discard this patch.
core/modifiers/mdf_memberof.inc.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,29 +2,29 @@
 block discarded – undo
2 2
 $userID = abs($modx->getLoginUserID('web'));
3 3
 $modx->qs_hash = md5($modx->qs_hash."^{$userID}^");
4 4
 
5
-$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array();
5
+$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array();
6 6
 
7 7
 // if $groupNames is not an array return false
8
-if(!is_array($groupNames)) return 0;
8
+if (!is_array($groupNames)) return 0;
9 9
 
10 10
 // Creates an array with all webgroups the user id is in
11 11
 if (isset($modx->getModifiers()->cache['mo'][$userID])) $grpNames = $modx->getModifiers()->cache['mo'][$userID];
12 12
 else {
13 13
     $from = sprintf(
14
-        $modx->getDatabase()->getFullTableName('webgroup_names') .
15
-        " wgn INNER JOIN " .
16
-        $modx->getDatabase()->getFullTableName('web_groups') .
14
+        $modx->getDatabase()->getFullTableName('webgroup_names').
15
+        " wgn INNER JOIN ".
16
+        $modx->getDatabase()->getFullTableName('web_groups').
17 17
         " wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",
18 18
 
19 19
         $userID
20 20
     );
21
-    $rs = $modx->getDatabase()->select('wgn.name',$from);
22
-    $modx->getModifiers()->cache['mo'][$userID] = $grpNames = $modx->getDatabase()->getColumn('name',$rs);
21
+    $rs = $modx->getDatabase()->select('wgn.name', $from);
22
+    $modx->getModifiers()->cache['mo'][$userID] = $grpNames = $modx->getDatabase()->getColumn('name', $rs);
23 23
 }
24 24
 
25 25
 // Check if a supplied group matches a webgroup from the array we just created
26
-foreach($groupNames as $k=>$v) {
27
-    if(in_array(trim($v),$grpNames)) return 1;
26
+foreach ($groupNames as $k=>$v) {
27
+    if (in_array(trim($v), $grpNames)) return 1;
28 28
 }
29 29
 
30 30
 // If we get here the above logic did not find a match, so return false
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,11 +5,14 @@  discard block
 block discarded – undo
5 5
 $groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array();
6 6
 
7 7
 // if $groupNames is not an array return false
8
-if(!is_array($groupNames)) return 0;
8
+if(!is_array($groupNames)) {
9
+    return 0;
10
+}
9 11
 
10 12
 // Creates an array with all webgroups the user id is in
11
-if (isset($modx->getModifiers()->cache['mo'][$userID])) $grpNames = $modx->getModifiers()->cache['mo'][$userID];
12
-else {
13
+if (isset($modx->getModifiers()->cache['mo'][$userID])) {
14
+    $grpNames = $modx->getModifiers()->cache['mo'][$userID];
15
+} else {
13 16
     $from = sprintf(
14 17
         $modx->getDatabase()->getFullTableName('webgroup_names') .
15 18
         " wgn INNER JOIN " .
@@ -24,8 +27,10 @@  discard block
 block discarded – undo
24 27
 
25 28
 // Check if a supplied group matches a webgroup from the array we just created
26 29
 foreach($groupNames as $k=>$v) {
27
-    if(in_array(trim($v),$grpNames)) return 1;
28
-}
30
+    if(in_array(trim($v),$grpNames)) {
31
+        return 1;
32
+    }
33
+    }
29 34
 
30 35
 // If we get here the above logic did not find a match, so return false
31 36
 return 0;
Please login to merge, or discard this patch.
core/modifiers/mdf_moduser.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-$userid = (int)$value;
2
+$userid = (int) $value;
3 3
 if (!isset($modx->getModifiers()->cache['ui'][$userid])) {
4 4
     if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid));
5 5
     else             $user = $modx->getUserInfo($userid);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 $userid = (int)$value;
3 3
 if (!isset($modx->getModifiers()->cache['ui'][$userid])) {
4
-    if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid));
5
-    else             $user = $modx->getUserInfo($userid);
4
+    if ($userid < 0) {
5
+        $user = $modx->getWebUserInfo(abs($userid));
6
+    } else {
7
+        $user = $modx->getUserInfo($userid);
8
+    }
6 9
     $modx->getModifiers()->cache['ui'][$userid] = $user;
7 10
 } else {
8 11
     $user = $modx->getModifiers()->cache['ui'][$userid];
Please login to merge, or discard this patch.
core/modifiers/mdf_wordwrap.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1 1
 <?php
2
-return preg_replace_callback("~(\b\w+\b)~",function($m) use($wrapat) {return wordwrap($m[1],$wrapat,' ',1);},$value);
2
+return preg_replace_callback("~(\b\w+\b)~", function($m) use($wrapat) {return wordwrap($m[1], $wrapat, ' ', 1); },$value);
Please login to merge, or discard this patch.
core/modifiers/mdf_summary.inc.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@
 block discarded – undo
1 1
 <?php
2
-if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt);
3
-elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';}
4
-else {$limit=124;$delim='';}
2
+if (strpos($opt, ',')) list($limit, $delim) = explode(',', $opt);
3
+elseif (preg_match('/^[1-9][0-9]*$/', $opt)) {$limit = $opt; $delim = ''; }
4
+else {$limit = 124; $delim = ''; }
5 5
 
6
-if($delim==='') $delim = $modx->getConfig('manager_language') === 'japanese-utf8' ? '。' : '.';
7
-$limit = (int)$limit;
6
+if ($delim === '') $delim = $modx->getConfig('manager_language') === 'japanese-utf8' ? '。' : '.';
7
+$limit = (int) $limit;
8 8
 
9 9
 $content = $modx->getModifiers()->parseDocumentSource($value);
10 10
 
11 11
 $content = strip_tags($content);
12 12
 
13
-$content = str_replace(array("\r\n","\r","\n","\t",'&nbsp;'),' ',$content);
14
-if(preg_match('/\s+/',$content))
15
-    $content = preg_replace('/\s+/',' ',$content);
13
+$content = str_replace(array("\r\n", "\r", "\n", "\t", '&nbsp;'), ' ', $content);
14
+if (preg_match('/\s+/', $content))
15
+    $content = preg_replace('/\s+/', ' ', $content);
16 16
 $content = trim($content);
17 17
 
18 18
 $pos = $modx->getModifiers()->strpos($content, $delim);
19 19
 
20
-if($pos!==false && $pos<$limit) {
20
+if ($pos !== false && $pos < $limit) {
21 21
     $_ = explode($delim, $content);
22 22
     $text = '';
23
-    foreach($_ as $v) {
24
-        if($limit <= $modx->getModifiers()->strlen($text.$v.$delim)) break;
23
+    foreach ($_ as $v) {
24
+        if ($limit <= $modx->getModifiers()->strlen($text.$v.$delim)) break;
25 25
         $text .= $v.$delim;
26 26
     }
27
-    if($text) $content = $text;
27
+    if ($text) $content = $text;
28 28
 }
29 29
 
30
-if($limit<$modx->getModifiers()->strlen($content) && strpos($content,' ')!==false) {
30
+if ($limit < $modx->getModifiers()->strlen($content) && strpos($content, ' ') !== false) {
31 31
     $_ = explode(' ', $content);
32 32
     $text = '';
33
-    foreach($_ as $v) {
34
-        if($limit <= $modx->getModifiers()->strlen($text.$v.' ')) break;
35
-        $text .= $v . ' ';
33
+    foreach ($_ as $v) {
34
+        if ($limit <= $modx->getModifiers()->strlen($text.$v.' ')) break;
35
+        $text .= $v.' ';
36 36
     }
37
-    if($text!=='') $content = $text;
37
+    if ($text !== '') $content = $text;
38 38
 }
39 39
 
40
-if($limit < $modx->getModifiers()->strlen($content)) $content = $modx->getModifiers()->substr($content, 0, $limit);
41
-if($modx->getModifiers()->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim;
40
+if ($limit < $modx->getModifiers()->strlen($content)) $content = $modx->getModifiers()->substr($content, 0, $limit);
41
+if ($modx->getModifiers()->substr($content, -1) == $delim) $content = rtrim($content, $delim).$delim;
42 42
 
43 43
 return $content;
Please login to merge, or discard this patch.
Braces   +28 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,9 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt);
3
-elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';}
4
-else {$limit=124;$delim='';}
2
+if(strpos($opt,',')) {
3
+    list($limit,$delim) = explode(',', $opt);
4
+} elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';} else {$limit=124;$delim='';}
5 5
 
6
-if($delim==='') $delim = $modx->getConfig('manager_language') === 'japanese-utf8' ? '。' : '.';
6
+if($delim==='') {
7
+    $delim = $modx->getConfig('manager_language') === 'japanese-utf8' ? '。' : '.';
8
+}
7 9
 $limit = (int)$limit;
8 10
 
9 11
 $content = $modx->getModifiers()->parseDocumentSource($value);
@@ -11,8 +13,9 @@  discard block
 block discarded – undo
11 13
 $content = strip_tags($content);
12 14
 
13 15
 $content = str_replace(array("\r\n","\r","\n","\t",'&nbsp;'),' ',$content);
14
-if(preg_match('/\s+/',$content))
16
+if(preg_match('/\s+/',$content)) {
15 17
     $content = preg_replace('/\s+/',' ',$content);
18
+}
16 19
 $content = trim($content);
17 20
 
18 21
 $pos = $modx->getModifiers()->strpos($content, $delim);
@@ -21,23 +24,35 @@  discard block
 block discarded – undo
21 24
     $_ = explode($delim, $content);
22 25
     $text = '';
23 26
     foreach($_ as $v) {
24
-        if($limit <= $modx->getModifiers()->strlen($text.$v.$delim)) break;
27
+        if($limit <= $modx->getModifiers()->strlen($text.$v.$delim)) {
28
+            break;
29
+        }
25 30
         $text .= $v.$delim;
26 31
     }
27
-    if($text) $content = $text;
28
-}
32
+    if($text) {
33
+        $content = $text;
34
+    }
35
+    }
29 36
 
30 37
 if($limit<$modx->getModifiers()->strlen($content) && strpos($content,' ')!==false) {
31 38
     $_ = explode(' ', $content);
32 39
     $text = '';
33 40
     foreach($_ as $v) {
34
-        if($limit <= $modx->getModifiers()->strlen($text.$v.' ')) break;
41
+        if($limit <= $modx->getModifiers()->strlen($text.$v.' ')) {
42
+            break;
43
+        }
35 44
         $text .= $v . ' ';
36 45
     }
37
-    if($text!=='') $content = $text;
38
-}
46
+    if($text!=='') {
47
+        $content = $text;
48
+    }
49
+    }
39 50
 
40
-if($limit < $modx->getModifiers()->strlen($content)) $content = $modx->getModifiers()->substr($content, 0, $limit);
41
-if($modx->getModifiers()->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim;
51
+if($limit < $modx->getModifiers()->strlen($content)) {
52
+    $content = $modx->getModifiers()->substr($content, 0, $limit);
53
+}
54
+if($modx->getModifiers()->substr($content,-1)==$delim) {
55
+    $content = rtrim($content,$delim) . $delim;
56
+}
42 57
 
43 58
 return $content;
Please login to merge, or discard this patch.
core/config/logging.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@
 block discarded – undo
40 40
 
41 41
         'single' => [
42 42
             'driver' => 'single',
43
-            'path' => EVO_STORAGE_PATH . 'logs/laravel.log',
43
+            'path' => EVO_STORAGE_PATH.'logs/laravel.log',
44 44
             'level' => 'debug',
45 45
         ],
46 46
 
47 47
         'daily' => [
48 48
             'driver' => 'daily',
49
-            'path' => EVO_STORAGE_PATH . 'logs/laravel.log',
49
+            'path' => EVO_STORAGE_PATH.'logs/laravel.log',
50 50
             'level' => 'debug',
51 51
             'days' => 7,
52 52
         ],
Please login to merge, or discard this patch.
core/config/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 return [
3 3
     'paths' => [
4
-        MODX_BASE_PATH . 'views/'
4
+        MODX_BASE_PATH.'views/'
5 5
     ],
6
-    'compiled' => EVO_STORAGE_PATH . 'blade/',
6
+    'compiled' => EVO_STORAGE_PATH.'blade/',
7 7
 ];
Please login to merge, or discard this patch.