Completed
Pull Request — develop (#522)
by Agel_Nash
07:16
created
manager/includes/extenders/modxmailer.class.inc.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 use PHPMailer\PHPMailer\PHPMailer;
12 12
 use PHPMailer\PHPMailer\Exception;
13 13
 
14
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php';
15
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php';
16
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/SMTP.php';
14
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/Exception.php';
15
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/PHPMailer.php';
16
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/SMTP.php';
17 17
 
18 18
 /**
19 19
  * Class MODxMailer
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function init(\DocumentParser $modx)
32 32
     {
33 33
         $this->modx = $modx;
34
-        $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/';
34
+        $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/';
35 35
 
36 36
         switch ($modx->config['email_method']) {
37 37
             case 'smtp':
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             mb_language($this->mb_language);
96 96
             mb_internal_encoding($modx->config['modx_charset']);
97 97
         }
98
-        $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php';
98
+        $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php';
99 99
         if (is_file($exconf)) {
100 100
             include($exconf);
101 101
         }
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
         }
164 164
 
165 165
         if ($this->modx->debug) {
166
-            $debug_info = 'CharSet = ' . $this->CharSet . "\n";
167
-            $debug_info .= 'Encoding = ' . $this->Encoding . "\n";
168
-            $debug_info .= 'mb_language = ' . $this->mb_language . "\n";
169
-            $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n";
166
+            $debug_info = 'CharSet = '.$this->CharSet."\n";
167
+            $debug_info .= 'Encoding = '.$this->Encoding."\n";
168
+            $debug_info .= 'mb_language = '.$this->mb_language."\n";
169
+            $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n";
170 170
             $debug_info .= "send_mode = {$mode}\n";
171
-            $debug_info .= 'Subject = ' . $this->Subject . "\n";
171
+            $debug_info .= 'Subject = '.$this->Subject."\n";
172 172
             $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>";
173 173
             $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information');
174 174
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             ini_set('sendmail_from', $old_from);
233 233
         }
234 234
         if (!$rt) {
235
-            $msg = $this->Lang('instantiate') . "<br />\n";
235
+            $msg = $this->Lang('instantiate')."<br />\n";
236 236
             $msg .= "{$this->Subject}<br />\n";
237 237
             $msg .= "{$this->FromName}&lt;{$this->From}&gt;<br />\n";
238 238
             $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public function SetError($msg)
253 253
     {
254
-        $msg .= '<pre>' . print_r(get_object_vars($this), true) . '</pre>';
254
+        $msg .= '<pre>'.print_r(get_object_vars($this), true).'</pre>';
255 255
         $this->modx->config['send_errormail'] = '0';
256 256
         $this->modx->logEvent(0, 3, $msg, 'phpmailer');
257 257
 
@@ -280,14 +280,14 @@  discard block
 block discarded – undo
280 280
     /**
281 281
      * @return string
282 282
      */
283
-    public function getMIMEHeader() {
283
+    public function getMIMEHeader(){
284 284
         return $this->MIMEHeader;
285 285
     }
286 286
 
287 287
     /**
288 288
      * @return string
289 289
      */
290
-    public function getMIMEBody() {
290
+    public function getMIMEBody(){
291 291
         return $this->MIMEBody;
292 292
     }
293 293
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      *
297 297
      * @return $this
298 298
      */
299
-    public function setMIMEHeader($header = '') {
299
+    public function setMIMEHeader($header = ''){
300 300
         $this->MIMEHeader = $header;
301 301
 
302 302
         return $this;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      *
308 308
      * @return $this
309 309
      */
310
-    public function setMIMEBody($body = '') {
310
+    public function setMIMEBody($body = ''){
311 311
         $this->MIMEBody = $body;
312 312
 
313 313
         return $this;
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      *
319 319
      * @return $this
320 320
      */
321
-    public function setMailHeader($header = '') {
321
+    public function setMailHeader($header = ''){
322 322
         $this->mailHeader = $header;
323 323
 
324 324
         return $this;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
     /**
328 328
      * @return string
329 329
      */
330
-    public function getMessageID() {
331
-        return trim($this->lastMessageID,'<>');
330
+    public function getMessageID(){
331
+        return trim($this->lastMessageID, '<>');
332 332
     }
333 333
 }
Please login to merge, or discard this patch.
manager/includes/mutate_settings.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
  * mutate_settings.ajax.php
4 4
  *
5 5
  */
6
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
6
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
7 7
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
8 8
 }
9 9
 
10
-require_once(dirname(__FILE__) . '/protect.inc.php');
10
+require_once(dirname(__FILE__).'/protect.inc.php');
11 11
 
12 12
 $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']);
13 13
 $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']);
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
 $str = '';
23 23
 $emptyCache = false;
24 24
 
25
-switch(true){
26
-    case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{
27
-        include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php');
28
-        $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ;
25
+switch (true) {
26
+    case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/', $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')):{
27
+        include(dirname(__FILE__).'/lang/'.$lang.'.inc.php');
28
+        $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : "";
29 29
         break;
30 30
     }
31 31
     case ($action == 'setsetting' && !empty($key) && !empty($value)):{
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     }
53 53
 }
54 54
 
55
-if($emptyCache) {
55
+if ($emptyCache) {
56 56
 	$modx->clearCache('full');
57 57
 }
58 58
 
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 
6 6
 // PROCESSOR FIRST
7
-if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
7
+if ($_SESSION['mgrRole'] == 1) {
8
+	if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9 9
 		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
10
+		if (!empty($current)) {
11 11
 			$modx->manager->setSystemChecksum($current);
12 12
 			$modx->clearCache('full');
13 13
 			$modx->config['sys_files_checksum'] = $current;
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check !== '0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29
-    if(@fileperms('includes/config.inc.php') & 0x0002) {
29
+    if (@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
31 31
       $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     $warnings[] = array($_lang['configcheck_php_gdzip']);
43 43
 }
44 44
 
45
-if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
-    if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
45
+if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
+    if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
47 47
         if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) {
48 48
             $warningspresent = 1;
49 49
             $warnings[] = array($_lang['configcheck_validate_referer']);
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 // check for Template Switcher plugin
55
-if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
-    if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
55
+if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
+    if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
57 57
         $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'");
58 58
         $row = $modx->db->getRow($rs);
59
-        if($row && $row['disabled'] == 0) {
59
+        if ($row && $row['disabled'] == 0) {
60 60
             $warningspresent = 1;
61 61
             $warnings[] = array($_lang['configcheck_templateswitcher_present']);
62 62
             $tplName = $row['name'];
@@ -117,36 +117,36 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 if (!function_exists('checkSiteCache')) {
120
-    function checkSiteCache() {
120
+    function checkSiteCache(){
121 121
         global $modx;
122
-        $checked= true;
123
-        if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
124
-            $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php');
122
+        $checked = true;
123
+        if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) {
124
+            $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php');
125 125
         }
126 126
         return $checked;
127 127
     }
128 128
 }
129 129
 
130
-if (!is_writable(MODX_BASE_PATH . "assets/cache/")) {
130
+if (!is_writable(MODX_BASE_PATH."assets/cache/")) {
131 131
     $warningspresent = 1;
132 132
     $warnings[] = array($_lang['configcheck_cache']);
133 133
 }
134 134
 
135 135
 if (!checkSiteCache()) {
136 136
     $warningspresent = 1;
137
-    $warnings[]= array($lang['configcheck_sitecache_integrity']);
137
+    $warnings[] = array($lang['configcheck_sitecache_integrity']);
138 138
 }
139 139
 
140
-if (!is_writable(MODX_BASE_PATH . "assets/images/")) {
140
+if (!is_writable(MODX_BASE_PATH."assets/images/")) {
141 141
     $warningspresent = 1;
142 142
     $warnings[] = array($_lang['configcheck_images']);
143 143
 }
144 144
 
145
-if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) {
145
+if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) {
146 146
     $warningspresent = 1;
147 147
     $warnings[] = array($_lang['configcheck_rb_base_dir']);
148 148
 }
149
-if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) {
149
+if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) {
150 150
     $warningspresent = 1;
151 151
     $warnings[] = array($_lang['configcheck_filemanager_path']);
152 152
 }
@@ -154,36 +154,36 @@  discard block
 block discarded – undo
154 154
 // clear file info cache
155 155
 clearstatcache();
156 156
 
157
-if ($warningspresent==1) {
157
+if ($warningspresent == 1) {
158 158
 
159
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
159
+if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3';
160 160
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
161 161
 
162
-for ($i=0;$i<count($warnings);$i++) {
162
+for ($i = 0; $i < count($warnings); $i++) {
163 163
     switch ($warnings[$i][0]) {
164 164
         case $_lang['configcheck_configinc'];
165 165
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
166
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
166
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']);
167 167
             break;
168 168
         case $_lang['configcheck_installer'] :
169 169
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
170
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
170
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']);
171 171
             break;
172 172
         case $_lang['configcheck_cache'] :
173 173
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
174
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
174
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']);
175 175
             break;
176 176
         case $_lang['configcheck_images'] :
177 177
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
178
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
178
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']);
179 179
             break;
180 180
         case $_lang['configcheck_sysfiles_mod']:
181 181
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
182
-			$warnings[$i][2] = '<ul><li>'. join('</li><li>', $sysfiles_check) .'</li></ul>';
183
-			if($modx->hasPermission('settings')) {
184
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
182
+			$warnings[$i][2] = '<ul><li>'.join('</li><li>', $sysfiles_check).'</li></ul>';
183
+			if ($modx->hasPermission('settings')) {
184
+				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>';
185 185
 			}
186
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".join(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
186
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".join(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']);
187 187
             break;
188 188
         case $_lang['configcheck_lang_difference'] :
189 189
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
@@ -205,18 +205,18 @@  discard block
 block discarded – undo
205 205
             break;
206 206
         case $_lang['configcheck_validate_referer'] :
207 207
             $msg = $_lang['configcheck_validate_referer_msg'];
208
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
208
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
209 209
             $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n";
210 210
             break;
211 211
         case $_lang['configcheck_templateswitcher_present'] :
212 212
             $msg = $_lang["configcheck_templateswitcher_present_msg"];
213
-            if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
214
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"];
213
+            if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
214
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"];
215 215
             }
216
-            if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
217
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"];
216
+            if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
217
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"];
218 218
             }
219
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
219
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
220 220
             $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n";
221 221
             break;
222 222
         case $_lang['configcheck_rb_base_dir'] :
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             $warnings[$i][1] = $_lang['configcheck_default_msg'];
230 230
     }
231 231
 
232
-    $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ;
232
+    $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : "";
233 233
     $config_check_results .= "
234 234
             <fieldset>
235 235
             <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p>
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
             ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')."
239 239
             </fieldset>
240 240
 ";
241
-        if ($i!=count($warnings)-1) {
241
+        if ($i != count($warnings) - 1) {
242 242
             $config_check_results .= "<br />";
243 243
         }
244 244
     }
245
-    $_SESSION["mgrConfigCheck"]=true;
245
+    $_SESSION["mgrConfigCheck"] = true;
246 246
 } else {
247 247
     $config_check_results = $_lang['configcheck_ok'];
248 248
 }
Please login to merge, or discard this patch.
manager/includes/active_user_locks.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         var stay = document.getElementById('stay');
19 19
         // Trigger unlock
20 20
         if ((stay && stay.value !== '2') || !form_save) {
21
-          var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random();
21
+          var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random();
22 22
           if (navigator.sendBeacon) {
23 23
             navigator.sendBeacon(url)
24 24
           } else {
Please login to merge, or discard this patch.
manager/includes/messageCount.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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
 
Please login to merge, or discard this patch.
manager/includes/protect.inc.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
     die();
11 11
 
12 12
 global $sanitize_seed;
13
-$sanitize_seed = 'sanitize_seed_' . base_convert(md5(__FILE__),16,36);
13
+$sanitize_seed = 'sanitize_seed_'.base_convert(md5(__FILE__), 16, 36);
14 14
 
15 15
 // sanitize array
16 16
 if (!function_exists('modx_sanitize_gpc')) {
17
-    function modx_sanitize_gpc(& $values, $depth=0) {
18
-        if(200 < $depth) exit('GPC Array nested too deep!');
19
-        if(is_array($values)) {
17
+    function modx_sanitize_gpc(& $values, $depth = 0){
18
+        if (200 < $depth) exit('GPC Array nested too deep!');
19
+        if (is_array($values)) {
20 20
             $depth++;
21 21
             foreach ($values as $key => $value) {
22 22
                 if (is_array($value)) modx_sanitize_gpc($value, $depth);
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
     }
30 30
 }
31 31
 
32
-function getSanitizedValue($value='') {
32
+function getSanitizedValue($value = ''){
33 33
     global $sanitize_seed;
34 34
 
35
-    if(!$value) return $value;
35
+    if (!$value) return $value;
36 36
 
37 37
     $brackets = explode(' ', '[[ ]] [! !] [* *] [( )] {{ }} [+ +] [~ ~] [^ ^]');
38
-    foreach($brackets as $bracket) {
39
-        if(strpos($value,$bracket)===false) continue;
40
-        $sanitizedBracket = str_replace('#', $sanitize_seed, sprintf('#%s#%s#', substr($bracket,0,1), substr($bracket,1,1)));
41
-        $value = str_replace($bracket,$sanitizedBracket,$value);
38
+    foreach ($brackets as $bracket) {
39
+        if (strpos($value, $bracket) === false) continue;
40
+        $sanitizedBracket = str_replace('#', $sanitize_seed, sprintf('#%s#%s#', substr($bracket, 0, 1), substr($bracket, 1, 1)));
41
+        $value = str_replace($bracket, $sanitizedBracket, $value);
42 42
     }
43 43
     $value = str_ireplace('<script', 'sanitized_by_modx<s cript', $value);
44 44
     $value = preg_replace('/&#(\d+);/', 'sanitized_by_modx& #$1', $value);
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 modx_sanitize_gpc($_GET);
49
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
49
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
50 50
     modx_sanitize_gpc($_POST);
51 51
 }
52 52
 modx_sanitize_gpc($_COOKIE);
53 53
 modx_sanitize_gpc($_REQUEST);
54 54
 
55
-foreach (array ('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) {
55
+foreach (array('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) {
56 56
     $_SERVER[$key] = isset ($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null;
57 57
 }
58 58
 
Please login to merge, or discard this patch.
manager/includes/manager.lockout.inc.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,75 +1,75 @@
 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
 
6
-if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){
6
+if ($modx->manager->action != '8' && isset($_SESSION['mgrValidated'])) {
7 7
 
8
-    $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start);
8
+    $homeurl = $modx->makeUrl($manager_login_startup > 0 ? $manager_login_startup : $site_start);
9 9
     $logouturl = MODX_MANAGER_URL.'index.php?a=8';
10 10
 
11
-    $modx->setPlaceholder('modx_charset',$modx_manager_charset);
12
-    $modx->setPlaceholder('theme',$manager_theme);
11
+    $modx->setPlaceholder('modx_charset', $modx_manager_charset);
12
+    $modx->setPlaceholder('theme', $manager_theme);
13 13
 
14
-    $modx->setPlaceholder('site_name',$site_name);
15
-    $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]);
16
-    $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]);
14
+    $modx->setPlaceholder('site_name', $site_name);
15
+    $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]);
16
+    $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]);
17 17
 
18
-    $modx->setPlaceholder('home',$_lang["home"]);
19
-    $modx->setPlaceholder('homeurl',$homeurl);
20
-    $modx->setPlaceholder('logout',$_lang["logout"]);
21
-    $modx->setPlaceholder('logouturl',$logouturl);
22
-    $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/');
23
-    $modx->setPlaceholder('year',date('Y'));
18
+    $modx->setPlaceholder('home', $_lang["home"]);
19
+    $modx->setPlaceholder('homeurl', $homeurl);
20
+    $modx->setPlaceholder('logout', $_lang["logout"]);
21
+    $modx->setPlaceholder('logouturl', $logouturl);
22
+    $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/');
23
+    $modx->setPlaceholder('year', date('Y'));
24 24
 
25 25
     // load template
26
-    if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) {
27
-    	$modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl';
26
+    if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) {
27
+    	$modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl';
28 28
     }
29 29
 
30 30
     $target = $modx->config['manager_lockout_tpl'];
31 31
     $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
32 32
     $target = $modx->mergeSettingsContent($target);
33 33
 
34
-    if(substr($target,0,1)==='@') {
35
-    	if(substr($target,0,6)==='@CHUNK') {
36
-    		$target = trim(substr($target,7));
34
+    if (substr($target, 0, 1) === '@') {
35
+    	if (substr($target, 0, 6) === '@CHUNK') {
36
+    		$target = trim(substr($target, 7));
37 37
     		$lockout_tpl = $modx->getChunk($target);
38 38
     	}
39
-    	elseif(substr($target,0,5)==='@FILE') {
40
-    		$target = trim(substr($target,6));
39
+    	elseif (substr($target, 0, 5) === '@FILE') {
40
+    		$target = trim(substr($target, 6));
41 41
     		$lockout_tpl = file_get_contents($target);
42 42
     	}
43 43
 	} else {
44 44
     	$chunk = $modx->getChunk($target);
45
-    	if($chunk!==false && !empty($chunk)) {
45
+    	if ($chunk !== false && !empty($chunk)) {
46 46
     		$lockout_tpl = $chunk;
47 47
     	}
48
-    	elseif(is_file(MODX_BASE_PATH . $target)) {
49
-    		$target = MODX_BASE_PATH . $target;
48
+    	elseif (is_file(MODX_BASE_PATH.$target)) {
49
+    		$target = MODX_BASE_PATH.$target;
50 50
     		$lockout_tpl = file_get_contents($target);
51 51
     	}
52
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) {
53
-    		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl';
52
+    	elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl')) {
53
+    		$target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl';
54 54
     		$lockout_tpl = file_get_contents($target);
55 55
     	}
56
-	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
57
-		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl';
56
+	elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl')) {
57
+		$target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl';
58 58
 		$login_tpl = file_get_contents($target);
59 59
 	}
60
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible
61
-    		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html';
60
+    	elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html')) { // ClipperCMS compatible
61
+    		$target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html';
62 62
     		$lockout_tpl = file_get_contents($target);
63 63
     	}
64 64
     	else {
65
-    		$target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl';
65
+    		$target = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl';
66 66
     		$lockout_tpl = file_get_contents($target);
67 67
     	}
68 68
 	}
69 69
 
70 70
     // merge placeholders
71 71
     $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl);
72
-    $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers
72
+    $regx = strpos($lockout_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers
73 73
     $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup
74 74
 
75 75
     echo $lockout_tpl;
Please login to merge, or discard this patch.
manager/includes/settings.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
 
6 6
 // get the settings from the database.
7 7
 $settings = array();
8
-if ($modx && count($modx->config)>0) $settings = $modx->config;
9
-else{
8
+if ($modx && count($modx->config) > 0) $settings = $modx->config;
9
+else {
10 10
 	$rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings'));
11 11
 	while ($row = $modx->db->getRow($rs)) {
12 12
 		$settings[$row['setting_name']] = $row['setting_value'];
@@ -16,4 +16,4 @@  discard block
 block discarded – undo
16 16
 extract($settings, EXTR_OVERWRITE);
17 17
 
18 18
 // setup default site id - new installation should generate a unique id for the site.
19
-if(!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3";
19
+if (!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3";
Please login to merge, or discard this patch.
manager/includes/secure_mgr_documents.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 
@@ -12,19 +12,19 @@  discard block
 block discarded – undo
12 12
  *
13 13
  */
14 14
 
15
-function secureMgrDocument($docid='') {
15
+function secureMgrDocument($docid = ''){
16 16
 	global $modx;
17 17
 
18
-	$modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1"));
18
+	$modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid > 0 ? "id='$docid'" : "privatemgr = 1"));
19 19
 	$rs = $modx->db->select(
20 20
 		'DISTINCT sc.id',
21 21
 		$modx->getFullTableName("site_content")." sc
22 22
 			LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id
23 23
 			LEFT JOIN ".$modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group",
24
-		($docid>0 ? " sc.id='{$docid}' AND ":"")."mga.id>0"
24
+		($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0"
25 25
 		);
26
-	$ids = $modx->db->getColumn("id",$rs);
27
-	if(count($ids)>0) {
28
-		$modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")");
26
+	$ids = $modx->db->getColumn("id", $rs);
27
+	if (count($ids) > 0) {
28
+		$modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ", $ids).")");
29 29
 	}
30 30
 }
Please login to merge, or discard this patch.