Completed
Pull Request — develop (#522)
by Agel_Nash
07:16
created
manager/includes/document.parser.class.inc.php 1 patch
Braces   +55 added lines, -26 removed lines patch added patch discarded remove patch
@@ -615,13 +615,15 @@  discard block
 block discarded – undo
615 615
             $this->virtualDir = '';
616 616
         }
617 617
 
618
-        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
618
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
619
+/* we got an ID returned, check to make sure it's not an alias */
619 620
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
620 621
             if ($this->config['use_alias_path'] == 1) {
621 622
                 if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
622 623
                     $this->documentMethod = 'id';
623 624
                     return $q;
624
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
625
+                } else {
626
+/* not a valid id in terms of virtualDir, treat as alias */
625 627
                     $this->documentMethod = 'alias';
626 628
                     return $q;
627 629
                 }
@@ -629,7 +631,8 @@  discard block
 block discarded – undo
629 631
                 $this->documentMethod = 'id';
630 632
                 return $q;
631 633
             }
632
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
634
+        } else {
635
+/* we didn't get an ID back, so instead we assume it's an alias */
633 636
             if ($this->config['friendly_alias_urls'] != 1) {
634 637
                 $q = $qOrig;
635 638
             }
@@ -659,13 +662,14 @@  discard block
 block discarded – undo
659 662
      * @param $id
660 663
      * @return array|mixed|null|string
661 664
      */
662
-    public function makePageCacheKey($id){
665
+    public function makePageCacheKey($id)
666
+    {
663 667
         $hash = $id;
664 668
         $tmp = null;
665 669
         $params = array();
666
-        if(!empty($this->systemCacheKey)){
670
+        if(!empty($this->systemCacheKey)) {
667 671
             $hash = $this->systemCacheKey;
668
-        }else {
672
+        } else {
669 673
             if (!empty($_GET)) {
670 674
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
671 675
                 $params = $_GET;
@@ -674,7 +678,7 @@  discard block
 block discarded – undo
674 678
             }
675 679
         }
676 680
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
677
-        if (is_array($evtOut) && count($evtOut) > 0){
681
+        if (is_array($evtOut) && count($evtOut) > 0) {
678 682
             $tmp = array_pop($evtOut);
679 683
         }
680 684
         return empty($tmp) ? $hash : $tmp;
@@ -1085,10 +1089,18 @@  discard block
 block discarded – undo
1085 1089
             return array();
1086 1090
         }
1087 1091
         $spacer = md5('<<<EVO>>>');
1088
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1089
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1090
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1091
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1092
+        if($left==='{{' && strpos($content,';}}')!==false) {
1093
+            $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1094
+        }
1095
+        if($left==='{{' && strpos($content,'{{}}')!==false) {
1096
+            $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1097
+        }
1098
+        if($left==='[[' && strpos($content,']]]]')!==false) {
1099
+            $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1100
+        }
1101
+        if($left==='[[' && strpos($content,']]]')!==false) {
1102
+            $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1103
+        }
1092 1104
 
1093 1105
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1094 1106
         $pos[']]>'] = strpos($content, ']]>');
@@ -1141,7 +1153,8 @@  discard block
 block discarded – undo
1141 1153
                         }
1142 1154
                     }
1143 1155
 
1144
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1156
+                    if (!in_array($fetch, $tags)) {
1157
+// Avoid double Matches
1145 1158
                         $tags[] = $fetch; // Fetch
1146 1159
                     };
1147 1160
                     $fetch = ''; // and reset
@@ -1159,7 +1172,9 @@  discard block
 block discarded – undo
1159 1172
             }
1160 1173
         }
1161 1174
         foreach($tags as $i=>$tag) {
1162
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1175
+            if(strpos($tag,$spacer)!==false) {
1176
+                $tags[$i] = str_replace($spacer, '', $tag);
1177
+            }
1163 1178
         }
1164 1179
         return $tags;
1165 1180
     }
@@ -1199,7 +1214,10 @@  discard block
 block discarded – undo
1199 1214
         }
1200 1215
 
1201 1216
         foreach ($matches[1] as $i => $key) {
1202
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1217
+            if(strpos($key,'[+')!==false) {
1218
+                continue;
1219
+            }
1220
+            // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1203 1221
             if (substr($key, 0, 1) == '#') {
1204 1222
                 $key = substr($key, 1);
1205 1223
             } // remove # for QuickEdit format
@@ -1921,7 +1939,8 @@  discard block
 block discarded – undo
1921 1939
      * @return mixed|string
1922 1940
      */
1923 1941
     function _getSGVar($value)
1924
-    { // Get super globals
1942
+    {
1943
+// Get super globals
1925 1944
         $key = $value;
1926 1945
         $_ = $this->config['enable_filter'];
1927 1946
         $this->config['enable_filter'] = 1;
@@ -2326,7 +2345,8 @@  discard block
 block discarded – undo
2326 2345
         if ($this->config['friendly_urls'] == 1) {
2327 2346
             $aliases = array();
2328 2347
             if (is_array($this->documentListing)) {
2329
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2348
+                foreach ($this->documentListing as $path => $docid) {
2349
+// This is big Loop on large site!
2330 2350
                     $aliases[$docid] = $path;
2331 2351
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2332 2352
                 }
@@ -2359,7 +2379,7 @@  discard block
 block discarded – undo
2359 2379
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2360 2380
             $pref = $this->config['friendly_url_prefix'];
2361 2381
             $suff = $this->config['friendly_url_suffix'];
2362
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2382
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2363 2383
                 global $modx;
2364 2384
                 $thealias = $aliases[$m[1]];
2365 2385
                 $thefolder = $isfolder[$m[1]];
@@ -4131,7 +4151,8 @@  discard block
 block discarded – undo
4131 4151
         if (isset ($this->snippetCache[$snippetName])) {
4132 4152
             $snippet = $this->snippetCache[$snippetName];
4133 4153
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4134
-        } else { // not in cache so let's check the db
4154
+        } else {
4155
+// not in cache so let's check the db
4135 4156
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4136 4157
             $result = $this->db->query($sql);
4137 4158
             if ($this->db->getRecordCount($result) == 1) {
@@ -4635,7 +4656,7 @@  discard block
 block discarded – undo
4635 4656
             $result = $this->db->makeArray($rs);
4636 4657
 
4637 4658
             // get default/built-in template variables
4638
-            if(is_array($docRow)){
4659
+            if(is_array($docRow)) {
4639 4660
                 ksort($docRow);
4640 4661
 
4641 4662
                 foreach ($docRow as $key => $value) {
@@ -5114,12 +5135,16 @@  discard block
 block discarded – undo
5114 5135
             return '';
5115 5136
         } // nothing to register
5116 5137
         if (!is_array($options)) {
5117
-            if (is_bool($options))  // backward compatibility with old plaintext parameter
5138
+            if (is_bool($options)) {
5139
+                // backward compatibility with old plaintext parameter
5118 5140
             {
5119 5141
                 $options = array('plaintext' => $options);
5120
-            } elseif (is_string($options)) // Also allow script name as 2nd param
5142
+            }
5143
+            } elseif (is_string($options)) {
5144
+                // Also allow script name as 2nd param
5121 5145
             {
5122 5146
                 $options = array('name' => $options);
5147
+            }
5123 5148
             } else {
5124 5149
                 $options = array();
5125 5150
             }
@@ -5131,7 +5156,8 @@  discard block
 block discarded – undo
5131 5156
         unset($overwritepos); // probably unnecessary--just making sure
5132 5157
 
5133 5158
         $useThisVer = true;
5134
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5159
+        if (isset($this->loadedjscripts[$key])) {
5160
+// a matching script was found
5135 5161
             // if existing script is a startup script, make sure the candidate is also a startup script
5136 5162
             if ($this->loadedjscripts[$key]['startup']) {
5137 5163
                 $startup = true;
@@ -5151,7 +5177,8 @@  discard block
 block discarded – undo
5151 5177
                     // overwrite the old script (the position may be important for dependent scripts)
5152 5178
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5153 5179
                 }
5154
-            } else { // Use the original version
5180
+            } else {
5181
+// Use the original version
5155 5182
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5156 5183
                     // need to move the exisiting script to the head
5157 5184
                     $version = $this->loadedjscripts[$key][$version];
@@ -5275,7 +5302,8 @@  discard block
 block discarded – undo
5275 5302
         }
5276 5303
 
5277 5304
         $results = null;
5278
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5305
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5306
+// start for loop
5279 5307
             if ($this->dumpPlugins) {
5280 5308
                 $eventtime = $this->getMicroTime();
5281 5309
             }
@@ -5823,7 +5851,8 @@  discard block
 block discarded – undo
5823 5851
      * @return bool
5824 5852
      */
5825 5853
     function isSafeCode($phpcode = '', $safe_functions = '')
5826
-    { // return true or false
5854
+    {
5855
+// return true or false
5827 5856
         if ($safe_functions == '') {
5828 5857
             return false;
5829 5858
         }
@@ -6239,7 +6268,7 @@  discard block
 block discarded – undo
6239 6268
             $args = array_pad(array(), $_, '$var');
6240 6269
             $args = implode(", ", $args);
6241 6270
             $modx = &$this;
6242
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6271
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6243 6272
                 $arg = $val['args'][$tmp - 1];
6244 6273
                 switch (true) {
6245 6274
                     case is_null($arg): {
Please login to merge, or discard this patch.
manager/processors/export_site.processor.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,16 +12,20 @@
 block discarded – undo
12 12
 $modx->loadExtension('EXPORT_SITE');
13 13
 
14 14
 
15
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
16
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
15
+if(is_dir(MODX_BASE_PATH . 'temp')) {
16
+    $export_dir = MODX_BASE_PATH . 'temp/export';
17
+} elseif(is_dir(MODX_BASE_PATH . 'assets')) {
18
+    $export_dir = MODX_BASE_PATH . 'assets/export';
19
+}
17 20
 $modx->export->targetDir = $export_dir;
18 21
 
19
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
22
+if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) {
20 23
 	return $_lang['export_site.static.php6'];
21
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
24
+} elseif($modx->config['rb_base_dir'] === $export_dir . '/') {
22 25
 	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
23
-elseif(!is_writable($export_dir))
26
+} elseif(!is_writable($export_dir)) {
24 27
 	return $_lang['export_site_target_unwritable'];
28
+}
25 29
 
26 30
 $modx->export->generate_mode = $_POST['generate_mode'];
27 31
 
Please login to merge, or discard this patch.
manager/processors/duplicate_content.processor.php 1 patch
Braces   +18 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
 $header="Location: index.php?r=1&a=3&id=$id";
37 37
 header($header);
38 38
 
39
-function duplicateDocument($docid, $parent=null, $_toplevel=0) {
39
+function duplicateDocument($docid, $parent=null, $_toplevel=0)
40
+{
40 41
 	global $modx, $_lang;
41 42
 
42 43
 	// invoke OnBeforeDocDuplicate event
@@ -57,8 +58,7 @@  discard block
 block discarded – undo
57 58
 	$content = $modx->db->getRow($rs);
58 59
 
59 60
 	// Handle incremental ID
60
-	switch($modx->config['docid_incrmnt_method'])
61
-	{
61
+	switch($modx->config['docid_incrmnt_method']) {
62 62
 		case '1':
63 63
 			$from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id";
64 64
 			$rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
@@ -79,8 +79,11 @@  discard block
 block discarded – undo
79 79
 		$pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
80 80
 		$pagetitle = $modx->db->escape($pagetitle);
81 81
 		$count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
82
-		if($count>=1) $count = ' '.($count+1);
83
-		else $count = '';
82
+		if($count>=1) {
83
+		    $count = ' '.($count+1);
84
+		} else {
85
+		    $count = '';
86
+		}
84 87
 
85 88
 		$content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
86 89
 		$content['alias'] = null;
@@ -89,7 +92,9 @@  discard block
 block discarded – undo
89 92
 	}
90 93
 
91 94
 	// change the parent accordingly
92
-	if ($parent !== null) $content['parent'] = $parent;
95
+	if ($parent !== null) {
96
+	    $content['parent'] = $parent;
97
+	}
93 98
 
94 99
 	// Change the author
95 100
 	$content['createdby'] = $userID;
@@ -129,15 +134,17 @@  discard block
 block discarded – undo
129 134
 	// Start duplicating all the child documents that aren't deleted.
130 135
 	$_toplevel++;
131 136
 	$rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC');
132
-		while ($row = $modx->db->getRow($rs))
133
-			duplicateDocument($row['id'], $newparent, $_toplevel);
137
+		while ($row = $modx->db->getRow($rs)) {
138
+					duplicateDocument($row['id'], $newparent, $_toplevel);
139
+		}
134 140
 
135 141
 	// return the new doc id
136 142
 	return $newparent;
137 143
 }
138 144
 
139 145
 // Duplicate Document TVs
140
-function duplicateTVs($oldid,$newid){
146
+function duplicateTVs($oldid,$newid)
147
+{
141 148
 	global $modx;
142 149
 
143 150
 	$tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
@@ -149,7 +156,8 @@  discard block
 block discarded – undo
149 156
 }
150 157
 
151 158
 // Duplicate Document Access Permissions
152
-function duplicateAccess($oldid,$newid){
159
+function duplicateAccess($oldid,$newid)
160
+{
153 161
 	global $modx;
154 162
 
155 163
 	$tbldg = $modx->getFullTableName('document_groups');
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate Plugin
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/duplicate_tmplvars.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate TV
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/remove_locks.processor.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	if(!$modx->hasPermission('remove_locks')) {
8
+	    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+	}
8 10
 
9 11
 	// Remove all locks
10 12
 	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
Please login to merge, or discard this patch.
manager/processors/web_access_groups.processor.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if($updategroupaccess==true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
manager/processors/move_document.processor.php 1 patch
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,12 +12,20 @@  discard block
 block discarded – undo
12 12
 // ok, two things to check.
13 13
 // first, document cannot be moved to itself
14 14
 // second, new parent must be a folder. If not, set it to folder.
15
-if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
16
-if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
17
-if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
15
+if($documentID==$newParentID) {
16
+    $modx->webAlertAndQuit($_lang["error_movedocument1"]);
17
+}
18
+if($documentID <= 0) {
19
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
20
+}
21
+if($newParentID < 0) {
22
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
23
+}
18 24
 
19 25
 $parents = $modx->getParentIds($newParentID);
20
-if (in_array($documentID, $parents))  $modx->webAlertAndQuit($_lang["error_movedocument2"]);
26
+if (in_array($documentID, $parents)) {
27
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
28
+}
21 29
 
22 30
 $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'");
23 31
 $oldparent = $modx->db->getValue($rs);
@@ -38,7 +46,8 @@  discard block
 block discarded – undo
38 46
 	}
39 47
 }
40 48
 
41
-function allChildren($currDocID) {
49
+function allChildren($currDocID)
50
+{
42 51
 	global $modx;
43 52
 	$children= array();
44 53
 	$rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'");
@@ -56,11 +65,11 @@  discard block
 block discarded – undo
56 65
 	"old_parent" => $oldparent,
57 66
 	"new_parent" => $newParentID
58 67
 ));
59
-if (is_array($evtOut) && count($evtOut) > 0){
68
+if (is_array($evtOut) && count($evtOut) > 0) {
60 69
 	$newParent = array_pop($evtOut);
61 70
 	if($newParent == $oldparent) {
62 71
 		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
63
-	}else{
72
+	} else {
64 73
 		$newParentID = $newParent;
65 74
 	}
66 75
 }
Please login to merge, or discard this patch.
manager/processors/duplicate_snippet.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate Snippet
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.