Completed
Push — develop ( af49d9...193edd )
by Maxim
09:39
created
manager/actions/search.static.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -118,18 +118,18 @@
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->getDatabase()->query($articul_query);
120 120
 		$articul_id_array = $modx->getDatabase()->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if(count($articul_id_array)>0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124 124
 			foreach( $articul_id_array as $articul ) {
125 125
 				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
126
+				if($i !== count($articul_id_array)) {
127 127
 					$articul_id.=',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab5_security_settings.inc.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
     $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4
3
-    if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) {
3
+    if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) {
4 4
         $valid_hostnames = $_SERVER['HTTP_HOST'];
5
-    } else {
5
+    } else {
6 6
         $valid_hostnames = $MODX_SITE_HOSTNAMES;
7 7
     }
8 8
 ?>
@@ -157,7 +157,9 @@  discard block
 block discarded – undo
157 157
 <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th>
158 158
 <td>
159 159
 <?php
160
-if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1;
160
+if(empty($pwd_hash_algo)) {
161
+    $phm['sel']['UNCRYPT'] = 1;
162
+}
161 163
 $phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
162 164
 $phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
163 165
 $phm['e']['SHA512']     = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0:1;
@@ -186,7 +188,9 @@  discard block
 block discarded – undo
186 188
   ?>
187 189
 <?php
188 190
 $gdAvailable = extension_loaded('gd');
189
-if(!$gdAvailable) $use_captcha = 0;
191
+if(!$gdAvailable) {
192
+    $use_captcha = 0;
193
+}
190 194
 ?>
191 195
   <tr>
192 196
     <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td>
@@ -226,7 +230,9 @@  discard block
 block discarded – undo
226 230
         <?php
227 231
             // invoke OnMiscSettingsRender event
228 232
             $evtOut = $modx->invokeEvent('OnSecuritySettingsRender');
229
-            if(is_array($evtOut)) echo implode("",$evtOut);
233
+            if(is_array($evtOut)) {
234
+                echo implode("",$evtOut);
235
+            }
230 236
         ?>
231 237
     </td>
232 238
   </tr>
Please login to merge, or discard this patch.
manager/actions/eventlog.dynamic.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('view_eventlog')) {
5
+if(!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 $modx->getManagerApi()->initPageViewState();
16 16
 
17 17
 // get and save search string
18
-if($_REQUEST['op'] == 'reset') {
18
+if($_REQUEST['op'] == 'reset') {
19 19
 	$sqlQuery = $query = '';
20 20
 	$_PAGE['vs']['search'] = '';
21
-} else {
21
+} else {
22 22
 	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
23
+	if(!is_numeric($sqlQuery)) {
24 24
 		$sqlQuery = $modx->getDatabase()->escape($query);
25 25
 	}
26 26
 	$_PAGE['vs']['search'] = $query;
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 					$grd->colWidths = "1%,,1%,1%,1%";
144 144
 					$grd->colAligns = "center,,,center,center";
145 145
 					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
-					if($listmode == '1') {
146
+					if($listmode == '1') {
147 147
 						$grd->pageSize = 0;
148 148
 					}
149
-					if($_REQUEST['op'] == 'reset') {
149
+					if($_REQUEST['op'] == 'reset') {
150 150
 						$grd->pageNumber = 1;
151 151
 					}
152 152
 					// render grid
Please login to merge, or discard this patch.
manager/processors/send_message.processor.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,9 +10,13 @@
 block discarded – undo
10 10
 $userid = $_REQUEST['user'];
11 11
 $groupid = $_REQUEST['group'];
12 12
 $subject = $modx->getDatabase()->escape($_REQUEST['messagesubject']);
13
-if($subject=="") $subject="(no subject)";
13
+if($subject=="") {
14
+    $subject="(no subject)";
15
+}
14 16
 $message = $modx->getDatabase()->escape($_REQUEST['messagebody']);
15
-if($message=="") $message="(no message)";
17
+if($message=="") {
18
+    $message="(no message)";
19
+}
16 20
 $postdate = time();
17 21
 
18 22
 if($sendto=='u') {
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
@@ -10,16 +10,20 @@
 block discarded – undo
10 10
 @set_time_limit($maxtime);
11 11
 
12 12
 
13
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
14
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
13
+if(is_dir(MODX_BASE_PATH . 'temp')) {
14
+    $export_dir = MODX_BASE_PATH . 'temp/export';
15
+} elseif(is_dir(MODX_BASE_PATH . 'assets')) {
16
+    $export_dir = MODX_BASE_PATH . 'assets/export';
17
+}
15 18
 $modx->getExportSite()->targetDir = $export_dir;
16 19
 
17
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
20
+if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) {
18 21
 	return $_lang['export_site.static.php6'];
19
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
22
+} elseif($modx->config['rb_base_dir'] === $export_dir . '/') {
20 23
 	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
21
-elseif(!is_writable($export_dir))
24
+} elseif(!is_writable($export_dir)) {
22 25
 	return $_lang['export_site_target_unwritable'];
26
+}
23 27
 
24 28
 $modx->getExportSite()->generate_mode = $_POST['generate_mode'];
25 29
 
Please login to merge, or discard this patch.
manager/processors/save_content.processor.php 1 patch
Braces   +23 added lines, -19 removed lines patch added patch discarded remove patch
@@ -134,8 +134,7 @@  discard block
 block discarded – undo
134 134
         }
135 135
         //end webber
136 136
     }
137
-}
138
-elseif ($alias) {
137
+} elseif ($alias) {
139 138
     $alias = $modx->stripAlias($alias);
140 139
 }
141 140
 
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 
150 149
     if ($pub_date < $currentdate) {
151 150
         $published = 1;
152
-    }
153
-    elseif ($pub_date > $currentdate) {
151
+    } elseif ($pub_date > $currentdate) {
154 152
         $published = 0;
155 153
     }
156 154
 }
@@ -277,8 +275,7 @@  discard block
 block discarded – undo
277 275
         case 'new' :
278 276
 
279 277
             // invoke OnBeforeDocFormSave event
280
-            switch($modx->config['docid_incrmnt_method'])
281
-            {
278
+            switch($modx->config['docid_incrmnt_method']) {
282 279
             case '1':
283 280
                 $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
284 281
                 $where = "T1.id IS NULL";
@@ -346,8 +343,9 @@  discard block
 block discarded – undo
346 343
             "alias_visible"    => $aliasvisible
347 344
         );
348 345
 
349
-        if ($id != '')
350
-            $dbInsert["id"] = $id;
346
+        if ($id != '') {
347
+                    $dbInsert["id"] = $id;
348
+        }
351 349
 
352 350
         $key = $modx->getDatabase()->insert($dbInsert, $tbl_site_content);
353 351
 
@@ -423,11 +421,13 @@  discard block
 block discarded – undo
423 421
         // redirect/stay options
424 422
         if ($_POST['stay'] != '') {
425 423
             // weblink
426
-            if ($_POST['mode'] == "72")
427
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
424
+            if ($_POST['mode'] == "72") {
425
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
426
+            }
428 427
             // document
429
-            if ($_POST['mode'] == "4")
430
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
428
+            if ($_POST['mode'] == "4") {
429
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
430
+            }
431 431
             $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'];
432 432
         } else {
433 433
             $header = "Location: index.php?a=3&id=$key&r=1";
@@ -488,10 +488,10 @@  discard block
 block discarded – undo
488 488
             if (!$was_published && $published) {
489 489
                 $publishedon = $currentdate;
490 490
                 $publishedby = $modx->getLoginUserID();
491
-                }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
491
+                } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
492 492
                 $publishedon = $pub_date;
493 493
                 $publishedby = $modx->getLoginUserID();
494
-                   }elseif ($was_published && !$published) {
494
+                   } elseif ($was_published && !$published) {
495 495
                 $publishedon = 0;
496 496
                 $publishedby = 0;
497 497
             } else {
@@ -547,7 +547,9 @@  discard block
 block discarded – undo
547 547
             $tvChanges = array();
548 548
             foreach ($tmplvars as $field => $value) {
549 549
                 if (!is_array($value)) {
550
-                    if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value];
550
+                    if (isset($tvIds[$value])) {
551
+                        $tvDeletions[] = $tvIds[$value];
552
+                    }
551 553
                 } else {
552 554
                     $tvId = $value[0];
553 555
                     $tvVal = $value[1];
@@ -595,7 +597,9 @@  discard block
 block discarded – undo
595 597
                     "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'"
596 598
                     );
597 599
                 $old_groups = array();
598
-                while ($row = $modx->getDatabase()->getRow($rs)) $old_groups[$row['document_group']] = $row['id'];
600
+                while ($row = $modx->getDatabase()->getRow($rs)) {
601
+                    $old_groups[$row['document_group']] = $row['id'];
602
+                }
599 603
 
600 604
                 // update the permissions in the database
601 605
                 $insertions = $deletions = array();
@@ -657,9 +661,9 @@  discard block
 block discarded – undo
657 661
                 $modx->clearCache('full');
658 662
             }
659 663
 
660
-            if ($_POST['refresh_preview'] == '1')
661
-                $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
662
-            else {
664
+            if ($_POST['refresh_preview'] == '1') {
665
+                            $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
666
+            } else {
663 667
                 if ($_POST['stay'] != '2' && $id > 0) {
664 668
                     $modx->unlockElement(7, $id);
665 669
                 }
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,17 +44,23 @@  discard block
 block discarded – undo
44 44
  * Initialize Document Parsing
45 45
  * -----------------------------
46 46
  */
47
-if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
47
+if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) {
48
+    $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
49
+}
48 50
 
49 51
 $base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
50
-if(is_file($base_path . 'assets/cache/siteManager.php'))
52
+if(is_file($base_path . 'assets/cache/siteManager.php')) {
51 53
     include_once($base_path . 'assets/cache/siteManager.php');
52
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
54
+}
55
+if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
53 56
 	define('MGR_DIR', 'manager');
54
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
57
+}
58
+if(is_file($base_path . 'assets/cache/siteHostnames.php')) {
55 59
     include_once($base_path . 'assets/cache/siteHostnames.php');
56
-if(!defined('MODX_SITE_HOSTNAMES'))
60
+}
61
+if(!defined('MODX_SITE_HOSTNAMES')) {
57 62
 	define('MODX_SITE_HOSTNAMES', '');
63
+}
58 64
 
59 65
 // get start time
60 66
 $mstart = memory_get_usage();
@@ -126,7 +132,7 @@  discard block
 block discarded – undo
126 132
     @ini_set("display_errors","0");
127 133
 }
128 134
 
129
-if(MODX_CLI){
135
+if(MODX_CLI) {
130 136
     @set_time_limit(0);
131 137
     @ini_set('max_execution_time',0);
132 138
 }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Modifiers.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -199,7 +199,8 @@  discard block
 block discarded – undo
199 199
             $c = substr($modifiers, 0, 1);
200 200
             $modifiers = substr($modifiers, 1);
201 201
 
202
-            if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>=
202
+            if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) {
203
+// :=, :!=, :<=, :>=, :!<=, :!>=
203 204
                 $c = substr($modifiers, strlen($match[1]), 1);
204 205
                 $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]";
205 206
                 if ($c === '(') {
@@ -215,7 +216,8 @@  discard block
 block discarded – undo
215 216
                 $result[] = array('cmd' => trim($match[1]), 'opt' => $opt, 'debuginfo' => $debuginfo);
216 217
                 $cmd = '';
217 218
             } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers,
218
-                    $match)) { // :+3, :-3, :*3 ...
219
+                    $match)) {
220
+// :+3, :-3, :*3 ...
219 221
                 $modifiers = substr($modifiers, strlen($match[0]));
220 222
                 $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]);
221 223
                 $cmd = '';
Please login to merge, or discard this patch.
manager/processors/duplicate_htmlsnippet.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->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "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 htmlsnippet
21 24
 $newid = $modx->getDatabase()->insert(
Please login to merge, or discard this patch.