Completed
Pull Request — develop (#725)
by Agel_Nash
08:07
created
manager/includes/user_settings.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 if (!empty($user_id)) {
15 15
     // Raymond: grab the user settings from the database.
16 16
     $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getFullTableName('user_settings'),
17
-        "user=" . $modx->getLoginUserID());
17
+        "user=".$modx->getLoginUserID());
18 18
 
19 19
     $which_browser_default = $which_browser;
20 20
     while ($row = $modx->getDatabase()->getRow($rs)) {
Please login to merge, or discard this patch.
manager/includes/secure_web_documents.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
         ($docid > 0 ? "id='$docid'" : "privateweb = 1"));
21 21
     $rs = $modx->getDatabase()->select(
22 22
         'DISTINCT sc.id',
23
-        $modx->getFullTableName("site_content") . " sc
24
-			LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id
25
-			LEFT JOIN " . $modx->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group",
26
-        ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0"
23
+        $modx->getFullTableName("site_content")." sc
24
+			LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id
25
+			LEFT JOIN " . $modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group",
26
+        ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0"
27 27
     );
28 28
     $ids = $modx->getDatabase()->getColumn("id", $rs);
29 29
     if (count($ids) > 0) {
30 30
         $modx->getDatabase()->update('privateweb = 1', $modx->getFullTableName("site_content"),
31
-            "id IN (" . implode(", ", $ids) . ")");
31
+            "id IN (".implode(", ", $ids).")");
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
manager/includes/footer.inc.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 global $SystemAlertMsgQueque;
6 6
 // display system alert window if messages are available
7 7
 if(count($SystemAlertMsgQueque) > 0) {
8
-	include "sysalert.display.inc.php";
8
+    include "sysalert.display.inc.php";
9 9
 }
10 10
 ?>
11 11
 <script type='text/javascript'>
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 </script>
20 20
 <?php
21 21
 if(in_array($modx->getManagerApi()->action, array(
22
-	85,
23
-	27,
24
-	4,
25
-	72,
26
-	13,
27
-	11,
28
-	12,
29
-	87,
30
-	88
22
+    85,
23
+    27,
24
+    4,
25
+    72,
26
+    13,
27
+    11,
28
+    12,
29
+    87,
30
+    88
31 31
 ))) {
32
-	echo $modx->getManagerApi()->loadDatePicker($modx->config['mgr_date_picker_path']);
32
+    echo $modx->getManagerApi()->loadDatePicker($modx->config['mgr_date_picker_path']);
33 33
 }
34 34
 ?>
35 35
 </body>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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 5
 global $SystemAlertMsgQueque;
6 6
 // display system alert window if messages are available
7
-if(count($SystemAlertMsgQueque) > 0) {
7
+if (count($SystemAlertMsgQueque) > 0) {
8 8
 	include "sysalert.display.inc.php";
9 9
 }
10 10
 ?>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	});
19 19
 </script>
20 20
 <?php
21
-if(in_array($modx->getManagerApi()->action, array(
21
+if (in_array($modx->getManagerApi()->action, array(
22 22
 	85,
23 23
 	27,
24 24
 	4,
Please login to merge, or discard this patch.
manager/includes/sysalert.display.inc.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-	/**
4
-	 *	System Alert Message Queue Display file
5
-	 *	Written By Raymond Irving, April, 2005
6
-	 *
7
-	 *	Used to display system alert messages inside the browser
8
-	 *
9
-	 */
3
+    /**
4
+     *	System Alert Message Queue Display file
5
+     *	Written By Raymond Irving, April, 2005
6
+     *
7
+     *	Used to display system alert messages inside the browser
8
+     *
9
+     */
10 10
 
11
-	require_once(dirname(__FILE__).'/protect.inc.php');
11
+    require_once(dirname(__FILE__).'/protect.inc.php');
12 12
 
13
-	$sysMsgs = "";
14
-	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
16
-		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
-	}
18
-	// reset message queque
19
-	unset($_SESSION['SystemAlertMsgQueque']);
20
-	$_SESSION['SystemAlertMsgQueque'] = array();
21
-	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
13
+    $sysMsgs = "";
14
+    $limit = count($SystemAlertMsgQueque);
15
+    for($i=0;$i<$limit;$i++) {
16
+        $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
+    }
18
+    // reset message queque
19
+    unset($_SESSION['SystemAlertMsgQueque']);
20
+    $_SESSION['SystemAlertMsgQueque'] = array();
21
+    $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+    if($sysMsgs!="") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
27
-	echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
27
+    echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
28 28
 ?>
29 29
 <script type="text/javascript">
30 30
 // <![CDATA[
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 // ]]>
43 43
 </script>
44 44
 <?php
45
-	}
45
+    }
46 46
 ?>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	$sysMsgs = "";
14 14
 	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
15
+	for ($i = 0; $i < $limit; $i++) {
16 16
 		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17 17
 	}
18 18
 	// reset message queque
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$_SESSION['SystemAlertMsgQueque'] = array();
21 21
 	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+	if ($sysMsgs != "") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			var sysAlert = new Element('div').setProperties({
33 33
 				'class': 'sysAlert'
34 34
 			});
35
-			sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs);?>';
35
+			sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs); ?>';
36 36
 			var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, {
37 37
 				buttons: 1,
38 38
 				button1: 'Ok',
Please login to merge, or discard this patch.
manager/includes/src/Legacy/ManagerApi.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -146,33 +146,33 @@  discard block
 block discarded – undo
146 146
             $algorithm = 'UNCRYPT';
147 147
         }
148 148
 
149
-        $salt = md5($password . $seed);
149
+        $salt = md5($password.$seed);
150 150
 
151 151
         switch ($algorithm) {
152 152
             case 'BLOWFISH_Y':
153
-                $salt = '$2y$07$' . substr($salt, 0, 22);
153
+                $salt = '$2y$07$'.substr($salt, 0, 22);
154 154
                 break;
155 155
             case 'BLOWFISH_A':
156
-                $salt = '$2a$07$' . substr($salt, 0, 22);
156
+                $salt = '$2a$07$'.substr($salt, 0, 22);
157 157
                 break;
158 158
             case 'SHA512':
159
-                $salt = '$6$' . substr($salt, 0, 16);
159
+                $salt = '$6$'.substr($salt, 0, 16);
160 160
                 break;
161 161
             case 'SHA256':
162
-                $salt = '$5$' . substr($salt, 0, 16);
162
+                $salt = '$5$'.substr($salt, 0, 16);
163 163
                 break;
164 164
             case 'MD5':
165
-                $salt = '$1$' . substr($salt, 0, 8);
165
+                $salt = '$1$'.substr($salt, 0, 8);
166 166
                 break;
167 167
         }
168 168
 
169 169
         if ($algorithm !== 'UNCRYPT') {
170
-            $password = sha1($password) . crypt($password, $salt);
170
+            $password = sha1($password).crypt($password, $salt);
171 171
         } else {
172
-            $password = sha1($salt . $password);
172
+            $password = sha1($salt.$password);
173 173
         }
174 174
 
175
-        $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8);
175
+        $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8);
176 176
 
177 177
         return $result;
178 178
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         $check_files = explode("\n", $check_files);
255 255
         foreach ($check_files as $file) {
256 256
             $file = trim($file);
257
-            $file = MODX_BASE_PATH . $file;
257
+            $file = MODX_BASE_PATH.$file;
258 258
             if (!is_file($file)) {
259 259
                 continue;
260 260
             }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $checksum = unserialize($checksum);
278 278
         foreach ($check_files as $file) {
279 279
             $file = trim($file);
280
-            $filePath = MODX_BASE_PATH . $file;
280
+            $filePath = MODX_BASE_PATH.$file;
281 281
             if (!is_file($filePath)) {
282 282
                 continue;
283 283
             }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     {
297 297
         $modx = evolutionCMS();
298 298
         $tbl_system_settings = $modx->getFullTableName('system_settings');
299
-        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->getDatabase()->escape($checksum) . "')";
299
+        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->getDatabase()->escape($checksum)."')";
300 300
         $modx->getDatabase()->query($sql);
301 301
     }
302 302
 
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
             foreach ($settings as $key => $val) {
374 374
                 $f = array();
375 375
                 $f['user'] = $_SESSION['mgrInternalKey'];
376
-                $f['setting_name'] = '_LAST_' . $key;
376
+                $f['setting_name'] = '_LAST_'.$key;
377 377
                 $f['setting_value'] = $val;
378 378
                 $f = $modx->getDatabase()->escape($f);
379
-                $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')";
379
+                $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')";
380 380
                 $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)";
381 381
                 $modx->getDatabase()->insert($f, $modx->getFullTableName('user_settings'));
382 382
             }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/ExportSite.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->count = 0;
60 60
         $this->setUrlMode();
61 61
         $this->generate_mode = 'crawl';
62
-        $this->targetDir = $modx->config['base_path'] . 'temp/export';
62
+        $this->targetDir = $modx->config['base_path'].'temp/export';
63 63
         if (!isset($this->total)) {
64 64
             $this->getTotal();
65 65
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids)));
116 116
         if (count($ignore_ids) > 0) {
117
-            $ignore_ids = "AND NOT id IN ('" . implode("','", $ignore_ids) . "')";
117
+            $ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')";
118 118
         } else {
119 119
             $ignore_ids = '';
120 120
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $noncache = ($noncache == 1) ? '' : 'AND cacheable=1';
125 125
         $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}";
126 126
         $rs = $modx->getDatabase()->select('count(id)', $tbl_site_content, $where);
127
-        $this->total = (int)$modx->getDatabase()->getValue($rs);
127
+        $this->total = (int) $modx->getDatabase()->getValue($rs);
128 128
 
129 129
         return $this->total;
130 130
     }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         } elseif (!is_readable($directory)) {
154 154
             return $rs;
155 155
         } else {
156
-            $files = glob($directory . '/*');
156
+            $files = glob($directory.'/*');
157 157
             if (!empty($files)) {
158 158
                 foreach ($files as $path) {
159 159
                     $rs = is_dir($path) ? $this->removeDirectoryAll($path) : unlink($path);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
             $_lang = $back_lang;
184 184
         } else {
185
-            $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}");
185
+            $src = $this->curl_get_contents(MODX_SITE_URL."index.php?id={$docid}");
186 186
         }
187 187
 
188 188
 
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
         $modx = evolutionCMS();
218 218
 
219 219
         if ($alias === '') {
220
-            $filename = $prefix . $docid . $suffix;
220
+            $filename = $prefix.$docid.$suffix;
221 221
         } else {
222 222
             if ($modx->config['suffix_mode'] === '1' && strpos($alias, '.') !== false) {
223 223
                 $suffix = '';
224 224
             }
225
-            $filename = $prefix . $alias . $suffix;
225
+            $filename = $prefix.$alias.$suffix;
226 226
         }
227 227
 
228 228
         return $filename;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $tbl_site_content = $modx->getFullTableName('site_content');
241 241
 
242 242
         $ignore_ids = $this->ignore_ids;
243
-        $dirpath = $this->targetDir . '/';
243
+        $dirpath = $this->targetDir.'/';
244 244
 
245 245
         $prefix = $modx->config['friendly_url_prefix'];
246 246
         $suffix = $modx->config['friendly_url_suffix'];
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
         $ph['status'] = 'fail';
252 252
         $ph['msg1'] = $_lang['export_site_failed'];
253
-        $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath;
253
+        $ph['msg2'] = $_lang["export_site_failed_no_write"].' - '.$dirpath;
254 254
         $msg_failed_no_write = $this->parsePlaceholder($tpl, $ph);
255 255
 
256 256
         $ph['msg2'] = $_lang["export_site_failed_no_retrieve"];
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
             if (!$row['wasNull']) { // needs writing a document
285 285
                 $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix);
286
-                $filename = $dirpath . $docname;
286
+                $filename = $dirpath.$docname;
287 287
                 if (!is_file($filename)) {
288 288
                     if ($row['published'] === '1') {
289 289
                         $status = $this->makeFile($row['id'], $filename);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'],
312 312
                         '.') === false)) { // needs making a folder
313 313
                 $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id'];
314
-                $dir_path = $dirpath . $end_dir;
314
+                $dir_path = $dirpath.$end_dir;
315 315
                 if (strpos($dir_path, MODX_BASE_PATH) === false) {
316 316
                     return false;
317 317
                 }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
                 if ($modx->config['make_folders'] === '1' && $row['published'] === '1') {
329 329
                     if (!empty($filename) && is_file($filename)) {
330
-                        rename($filename, $dir_path . '/index.html');
330
+                        rename($filename, $dir_path.'/index.html');
331 331
                     }
332 332
                 }
333 333
                 $this->targetDir = $dir_path;
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 
352 352
         $ch = curl_init();
353 353
         curl_setopt($ch, CURLOPT_URL, $url);
354
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);    // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT
355
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);    // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER
354
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT
355
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER
356 356
         curl_setopt($ch, CURLOPT_HEADER, false);
357 357
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
358 358
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Permissions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $role = $this->role;
40 40
 
41 41
         if ($role == 1) {
42
-            return true;  // administrator - grant all document permissions
42
+            return true; // administrator - grant all document permissions
43 43
         }
44 44
 
45 45
         if ($modx->config['use_udperms'] == 0 || $modx->config['use_udperms'] == "" || !isset($modx->config['use_udperms'])) {
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
             are private to the manager users will not be private to web users if the
67 67
             document group is not assigned to a web user group and visa versa.
68 68
          */
69
-        $permissionsok = false;  // set permissions to false
69
+        $permissionsok = false; // set permissions to false
70 70
 
71 71
         $rs = $modx->getDatabase()->select(
72 72
             'count(DISTINCT sc.id)',
73 73
             "{$tblsc} AS sc 
74 74
 				LEFT JOIN {$tbldg} AS dg on dg.document = sc.id 
75 75
 				LEFT JOIN {$tbldgn} dgn ON dgn.id = dg.document_group",
76
-            "sc.id='{$this->document}' AND (" . (empty($docgrp) ? '' : "dg.document_group = " . $docgrp . " ||") . " sc.privatemgr = 0)"
76
+            "sc.id='{$this->document}' AND (".(empty($docgrp) ? '' : "dg.document_group = ".$docgrp." ||")." sc.privatemgr = 0)"
77 77
         );
78 78
         $limit = $modx->getDatabase()->getValue($rs);
79 79
         if ($limit == 1) {
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Categories.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
21 21
 
22 22
         foreach ($this->elements as $element) {
23
-            $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element);
23
+            $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element);
24 24
         }
25 25
     }
26 26
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $this->getDatabase()->select(
55 55
                 '*',
56 56
                 $this->db_tbl['categories'],
57
-                "`" . $where . "` = '" . $this->getDatabase()->escape($search) . "'"
57
+                "`".$where."` = '".$this->getDatabase()->escape($search)."'"
58 58
             )
59 59
         );
60 60
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $_value = $this->getDatabase()->getValue(
73 73
             $this->getDatabase()->select(
74
-                '`' . $value . '`',
74
+                '`'.$value.'`',
75 75
                 $this->db_tbl['categories'],
76
-                "`" . $where . "` = '" . $this->getDatabase()->escape($search) . "'"
76
+                "`".$where."` = '".$this->getDatabase()->escape($search)."'"
77 77
             )
78 78
         );
79 79
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 $this->getDatabase()->select(
93 93
                     '*',
94 94
                     $this->db_tbl[$element],
95
-                    "`category` = '" . (int)$category_id . "'"
95
+                    "`category` = '".(int) $category_id."'"
96 96
                 )
97 97
             );
98 98
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
             $this->getDatabase()->update(
136 136
                 $_update,
137 137
                 $this->db_tbl[$element],
138
-                "`category` = '" . (int)$category_id . "'"
138
+                "`category` = '".(int) $category_id."'"
139 139
             );
140 140
         }
141 141
 
142 142
         $this->getDatabase()->delete(
143 143
             $this->db_tbl['categories'],
144
-            "`id` = '" . (int)$category_id . "'"
144
+            "`id` = '".(int) $category_id."'"
145 145
         );
146 146
 
147 147
         return $this->getDatabase()->getAffectedRows() === 1;
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
 
161 161
         $_update = array(
162 162
             'category' => $this->getDatabase()->escape($data['category']),
163
-            'rank'     => (int)$data['rank']
163
+            'rank'     => (int) $data['rank']
164 164
         );
165 165
 
166 166
         $this->getDatabase()->update(
167 167
             $_update,
168 168
             $this->db_tbl['categories'],
169
-            "`id` = '" . (int)$category_id . "'"
169
+            "`id` = '".(int) $category_id."'"
170 170
         );
171 171
 
172 172
         if ($this->getDatabase()->getAffectedRows() === 1) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         $_insert = array(
191 191
             'category' => $this->getDatabase()->escape($category_name),
192
-            'rank'     => (int)$category_rank
192
+            'rank'     => (int) $category_rank
193 193
         );
194 194
 
195 195
         $this->getDatabase()->insert(
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $this->getDatabase()->select(
217 217
                 '`id`',
218 218
                 $this->db_tbl['categories'],
219
-                "`category` = '" . $category . "'"
219
+                "`category` = '".$category."'"
220 220
             )
221 221
         );
222 222
 
Please login to merge, or discard this patch.
manager/includes/src/Legacy/LogHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
         $action = "",
37 37
         $itemid = "",
38 38
         $itemname = ""
39
-    ) {
39
+    ){
40 40
         $modx = evolutionCMS();
41 41
         $this->entry['msg'] = $msg; // writes testmessage to the object
42
-        $this->entry['action'] = empty($action) ? $modx->getManagerApi()->action : $action;    // writes the action to the object
42
+        $this->entry['action'] = empty($action) ? $modx->getManagerApi()->action : $action; // writes the action to the object
43 43
 
44 44
         // User Credentials
45 45
         $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey;
46 46
         $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username;
47 47
 
48
-        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid;  // writes the id to the object
48
+        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object
49 49
         if ($this->entry['itemId'] == 0) {
50 50
             $this->entry['itemId'] = "-";
51 51
         } // to stop items having id 0
@@ -96,20 +96,20 @@  discard block
 block discarded – undo
96 96
 
97 97
         $insert_id = $modx->getDatabase()->insert($fields, $tbl_manager_log);
98 98
         if (!$insert_id) {
99
-            $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->getDatabase()->getLastError());
99
+            $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->getDatabase()->getLastError());
100 100
         } else {
101
-            $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000;
102
-            $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100;
101
+            $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000;
102
+            $trim = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100;
103 103
             if (($insert_id % $trim) === 0) {
104 104
                 $modx->rotate_log('manager_log', $limit, $trim);
105 105
             }
106 106
         }
107 107
     }
108 108
 
109
-    private function getUserIP() {
110
-        if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
111
-            if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) {
112
-                $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']);
109
+    private function getUserIP(){
110
+        if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
111
+            if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0) {
112
+                $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
113 113
                 return trim($addr[0]);
114 114
             } else {
115 115
                 return $_SERVER['HTTP_X_FORWARDED_FOR'];
Please login to merge, or discard this patch.