Completed
Pull Request — develop (#725)
by Agel_Nash
21:22 queued 08:56
created
index.php 3 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  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'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
48 48
 
49
-$base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
50
-if(is_file($base_path . 'assets/cache/siteManager.php'))
51
-    include_once($base_path . 'assets/cache/siteManager.php');
52
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
49
+$base_path = str_replace('\\', '/', dirname(__FILE__)).'/';
50
+if (is_file($base_path.'assets/cache/siteManager.php'))
51
+    include_once($base_path.'assets/cache/siteManager.php');
52
+if (!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53 53
 	define('MGR_DIR', 'manager');
54
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55
-    include_once($base_path . 'assets/cache/siteHostnames.php');
56
-if(!defined('MODX_SITE_HOSTNAMES'))
54
+if (is_file($base_path.'assets/cache/siteHostnames.php'))
55
+    include_once($base_path.'assets/cache/siteHostnames.php');
56
+if (!defined('MODX_SITE_HOSTNAMES'))
57 57
 	define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 // set some settings, and address some IE issues
66 66
 @ini_set('url_rewriter.tags', '');
67 67
 @ini_set('session.use_trans_sid', 0);
68
-@ini_set('session.use_only_cookies',1);
68
+@ini_set('session.use_only_cookies', 1);
69 69
 session_cache_limiter('');
70 70
 header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
71 71
 header('Cache-Control: private, must-revalidate');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80
-if ( ! defined('IN_MANAGER_MODE')) {
80
+if (!defined('IN_MANAGER_MODE')) {
81 81
 	define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 // get the required includes
88
-if(! isset($database_user) || $database_user==="") {
89
-    $rt = @include_once(__DIR__ . '/' . MGR_DIR . '/includes/config.inc.php');
88
+if (!isset($database_user) || $database_user === "") {
89
+    $rt = @include_once(__DIR__.'/'.MGR_DIR.'/includes/config.inc.php');
90 90
     $path = 'install/src/template/not_installed.tpl';
91 91
     // Be sure config.inc.php is there and that it contains some important values
92 92
     if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 $modx->stopOnNotice = false;
123 123
 
124 124
 // Don't show PHP errors to the public
125
-if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
-    @ini_set("display_errors","0");
125
+if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
+    @ini_set("display_errors", "0");
127 127
 }
128 128
 
129
-if(MODX_CLI){
129
+if (MODX_CLI) {
130 130
     @set_time_limit(0);
131
-    @ini_set('max_execution_time',0);
131
+    @ini_set('max_execution_time', 0);
132 132
 }
133 133
 
134 134
 // execute the parser if index.php was not included
Please login to merge, or discard this 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.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 if(is_file($base_path . 'assets/cache/siteManager.php'))
51 51
     include_once($base_path . 'assets/cache/siteManager.php');
52 52
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53
-	define('MGR_DIR', 'manager');
53
+    define('MGR_DIR', 'manager');
54 54
 if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55 55
     include_once($base_path . 'assets/cache/siteHostnames.php');
56 56
 if(!defined('MODX_SITE_HOSTNAMES'))
57
-	define('MODX_SITE_HOSTNAMES', '');
57
+    define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
60 60
 $mstart = memory_get_usage();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80 80
 if ( ! defined('IN_MANAGER_MODE')) {
81
-	define('IN_MANAGER_MODE', false);
81
+    define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
84 84
     define('MODX_API_MODE', false);
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Modifiers.php 3 patches
Doc Comments   +26 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     /**
102 102
      * @param string $mode
103 103
      * @param string $modifiers
104
-     * @return bool|string
104
+     * @return false|string
105 105
      */
106 106
     public function _getDelim($mode, $modifiers)
107 107
     {
@@ -151,6 +151,13 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 
154
+    /**
155
+     * @param string $mode
156
+     * @param false|string $delim
157
+     * @param string $modifiers
158
+     *
159
+     * @return string
160
+     */
154 161
     public function _getRemainModifiers($mode, $delim, $modifiers)
155 162
     {
156 163
         if ($delim) {
@@ -187,6 +194,9 @@  discard block
 block discarded – undo
187 194
         return substr($string, strpos($string, $delim) + $len);
188 195
     }
189 196
 
197
+    /**
198
+     * @param string $modifiers
199
+     */
190 200
     public function splitEachModifiers($modifiers)
191 201
     {
192 202
         $modx = evolutionCMS();
@@ -259,6 +269,10 @@  discard block
 block discarded – undo
259 269
         return $result;
260 270
     }
261 271
 
272
+    /**
273
+     * @param string $key
274
+     * @param string $value
275
+     */
262 276
     public function parsePhx($key, $value, $modifiers)
263 277
     {
264 278
         $modx = evolutionCMS();
@@ -340,6 +354,10 @@  discard block
 block discarded – undo
340 354
         }
341 355
     }
342 356
 
357
+    /**
358
+     * @param string $cmd
359
+     * @param string $opt
360
+     */
343 361
     public function getValueFromPreset($key, $value, $cmd, $opt)
344 362
     {
345 363
         $modx = evolutionCMS();
@@ -1285,6 +1303,9 @@  discard block
 block discarded – undo
1285 1303
         return $value;
1286 1304
     }
1287 1305
 
1306
+    /**
1307
+     * @param string $cmd
1308
+     */
1288 1309
     public function includeMdfFile($cmd)
1289 1310
     {
1290 1311
         $modx = evolutionCMS();
@@ -1477,6 +1498,10 @@  discard block
 block discarded – undo
1477 1498
     }
1478 1499
 
1479 1500
     // Sets a placeholder variable which can only be access by Modifiers
1501
+
1502
+    /**
1503
+     * @param string $value
1504
+     */
1480 1505
     public function setModifiersVariable($key, $value)
1481 1506
     {
1482 1507
         if ($key != 'phx' && $key != 'dummy') {
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         }
83 83
         $this->srcValue = $value;
84 84
         $modifiers = trim($modifiers);
85
-        $modifiers = ':' . trim($modifiers, ':');
85
+        $modifiers = ':'.trim($modifiers, ':');
86 86
         $modifiers = str_replace(array("\r\n", "\r"), "\n", $modifiers);
87 87
         $modifiers = $this->splitEachModifiers($modifiers);
88 88
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         if ($delim) {
131 131
             if ($mode == '(') {
132
-                return substr($modifiers, 1, strpos($modifiers, $delim . ')') - 1);
132
+                return substr($modifiers, 1, strpos($modifiers, $delim.')') - 1);
133 133
             }
134 134
 
135 135
             return substr($modifiers, 1, strpos($modifiers, $delim, 1) - 1);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         if ($delim) {
157 157
             if ($mode == '(') {
158
-                return $this->_fetchContent($modifiers, $delim . ')');
158
+                return $this->_fetchContent($modifiers, $delim.')');
159 159
             } else {
160 160
                 $modifiers = trim($modifiers);
161 161
                 $modifiers = substr($modifiers, 1);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers,
218 218
                     $match)) { // :+3, :-3, :*3 ...
219 219
                 $modifiers = substr($modifiers, strlen($match[0]));
220
-                $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]);
220
+                $result[] = array('cmd' => 'math', 'opt' => '%s'.$c.$match[0]);
221 221
                 $cmd = '';
222 222
             } elseif ($c === '(' || $c === '=') {
223 223
                 $modifiers = $m1 = trim($modifiers);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         }
333 333
 
334 334
         $_ = explode(',',
335
-            $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
335
+            $this->condModifiers.',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
336 336
         if (in_array($cmd, $_)) {
337 337
             return false;
338 338
         } else {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             case 'eq':
366 366
             case 'is':
367 367
             case 'equals':
368
-                $this->condition[] = (int)($value == $opt);
368
+                $this->condition[] = (int) ($value == $opt);
369 369
                 break;
370 370
             case 'neq':
371 371
             case 'ne':
@@ -373,59 +373,59 @@  discard block
 block discarded – undo
373 373
             case 'isnot':
374 374
             case 'isnt':
375 375
             case 'not':
376
-                $this->condition[] = (int)($value != $opt);
376
+                $this->condition[] = (int) ($value != $opt);
377 377
                 break;
378 378
             case '%':
379
-                $this->condition[] = (int)($value % $opt == 0);
379
+                $this->condition[] = (int) ($value % $opt == 0);
380 380
                 break;
381 381
             case 'isempty':
382
-                $this->condition[] = (int)(empty($value));
382
+                $this->condition[] = (int) (empty($value));
383 383
                 break;
384 384
             case 'isntempty':
385 385
             case 'isnotempty':
386
-                $this->condition[] = (int)(!empty($value));
386
+                $this->condition[] = (int) (!empty($value));
387 387
                 break;
388 388
             case '>=':
389 389
             case 'gte':
390 390
             case 'eg':
391 391
             case 'isgte':
392
-                $this->condition[] = (int)($value >= $opt);
392
+                $this->condition[] = (int) ($value >= $opt);
393 393
                 break;
394 394
             case '<=':
395 395
             case 'lte':
396 396
             case 'el':
397 397
             case 'islte':
398
-                $this->condition[] = (int)($value <= $opt);
398
+                $this->condition[] = (int) ($value <= $opt);
399 399
                 break;
400 400
             case '>':
401 401
             case 'gt':
402 402
             case 'greaterthan':
403 403
             case 'isgreaterthan':
404 404
             case 'isgt':
405
-                $this->condition[] = (int)($value > $opt);
405
+                $this->condition[] = (int) ($value > $opt);
406 406
                 break;
407 407
             case '<':
408 408
             case 'lt':
409 409
             case 'lowerthan':
410 410
             case 'islowerthan':
411 411
             case 'islt':
412
-                $this->condition[] = (int)($value < $opt);
412
+                $this->condition[] = (int) ($value < $opt);
413 413
                 break;
414 414
             case 'find':
415
-                $this->condition[] = (int)(strpos($value, $opt) !== false);
415
+                $this->condition[] = (int) (strpos($value, $opt) !== false);
416 416
                 break;
417 417
             case 'inarray':
418 418
             case 'in_array':
419 419
             case 'in':
420 420
                 $opt = explode(',', $opt);
421
-                $this->condition[] = (int)(in_array($value, $opt) !== false);
421
+                $this->condition[] = (int) (in_array($value, $opt) !== false);
422 422
                 break;
423 423
             case 'wildcard_match':
424 424
             case 'wcard_match':
425 425
             case 'wildcard':
426 426
             case 'wcard':
427 427
             case 'fnmatch':
428
-                $this->condition[] = (int)(fnmatch($opt, $value) !== false);
428
+                $this->condition[] = (int) (fnmatch($opt, $value) !== false);
429 429
                 break;
430 430
             case 'is_file':
431 431
             case 'is_dir':
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                 if (strpos($path, $modx->config['base_path']) === false) {
444 444
                     $path = ltrim($path, '/');
445 445
                 }
446
-                $this->condition[] = (int)($cmd($path) !== false);
446
+                $this->condition[] = (int) ($cmd($path) !== false);
447 447
                 break;
448 448
             case 'is_image':
449 449
                 if (!$opt) {
@@ -456,13 +456,13 @@  discard block
 block discarded – undo
456 456
                     break;
457 457
                 }
458 458
                 $_ = getimagesize($path);
459
-                $this->condition[] = (int)($_[0]);
459
+                $this->condition[] = (int) ($_[0]);
460 460
                 break;
461 461
             case 'regex':
462 462
             case 'preg':
463 463
             case 'preg_match':
464 464
             case 'isinrole':
465
-                $this->condition[] = (int)(preg_match($opt, $value));
465
+                $this->condition[] = (int) (preg_match($opt, $value));
466 466
                 break;
467 467
             case 'ir':
468 468
             case 'memberof':
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
             case 'show':
480 480
             case 'this':
481 481
                 $conditional = implode(' ', $this->condition);
482
-                $isvalid = (int)(eval("return ({$conditional});"));
482
+                $isvalid = (int) (eval("return ({$conditional});"));
483 483
                 if ($isvalid) {
484 484
                     return $this->srcValue;
485 485
                 }
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                 return null;
488 488
             case 'then':
489 489
                 $conditional = implode(' ', $this->condition);
490
-                $isvalid = (int)eval("return ({$conditional});");
490
+                $isvalid = (int) eval("return ({$conditional});");
491 491
                 if ($isvalid) {
492 492
                     return $opt;
493 493
                 }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                 return null;
496 496
             case 'else':
497 497
                 $conditional = implode(' ', $this->condition);
498
-                $isvalid = (int)eval("return ({$conditional});");
498
+                $isvalid = (int) eval("return ({$conditional});");
499 499
                 if (!$isvalid) {
500 500
                     return $opt;
501 501
                 }
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                 return $this->strpos($value, $opt);
655 655
             case 'wordwrap':
656 656
                 // default: 70
657
-                $wrapat = (int)$opt > 0 ? (int)$opt : 70;
657
+                $wrapat = (int) $opt > 0 ? (int) $opt : 70;
658 658
                 if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
659 659
                     return $this->includeMdfFile('wordwrap');
660 660
                 } else {
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 if (strpos($opt, ',') !== false) {
687 687
                     list($b, $e) = explode(',', $opt, 2);
688 688
 
689
-                    return $this->substr($value, $b, (int)$e);
689
+                    return $this->substr($value, $b, (int) $e);
690 690
                 } else {
691 691
                     return $this->substr($value, $opt);
692 692
                 }
@@ -705,9 +705,9 @@  discard block
 block discarded – undo
705 705
                     $str = '';
706 706
                 }
707 707
                 if (preg_match('/^[1-9][0-9]*$/', $len)) {
708
-                    return $this->substr($value, 0, $len) . $str;
708
+                    return $this->substr($value, 0, $len).$str;
709 709
                 } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) {
710
-                    return $str . $this->substr($value, $len);
710
+                    return $str.$this->substr($value, $len);
711 711
                 }
712 712
                 break;
713 713
             case 'summary':
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
             case 'concatenate':
773 773
             case '.':
774 774
                 if ($value !== '') {
775
-                    return $value . $opt;
775
+                    return $value.$opt;
776 776
                 }
777 777
                 break;
778 778
             case 'sprintf':
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             case 'money_format':
791 791
                 setlocale(LC_MONETARY, setlocale(LC_TIME, 0));
792 792
                 if ($value !== '') {
793
-                    return money_format($opt, (double)$value);
793
+                    return money_format($opt, (double) $value);
794 794
                 }
795 795
                 break;
796 796
             case 'tobool':
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                 return strtotime($value);
866 866
             #####  mathematical function
867 867
             case 'toint':
868
-                return (int)$value;
868
+                return (int) $value;
869 869
             case 'tofloat':
870 870
                 return floatval($value);
871 871
             case 'round':
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 return $cmd($value);
884 884
             case 'math':
885 885
             case 'calc':
886
-                $value = (int)$value;
886
+                $value = (int) $value;
887 887
                 if (empty($value)) {
888 888
                     $value = '0';
889 889
                 }
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
                 $where = implode(' AND ', $where);
1027 1027
                 $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where);
1028 1028
                 $result = array();
1029
-                foreach ((array)$children as $child) {
1029
+                foreach ((array) $children as $child) {
1030 1030
                     $result[] = $child['id'];
1031 1031
                 }
1032 1032
 
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                     $opt .= '/';
1131 1131
                 }
1132 1132
 
1133
-                $filename = MODX_BASE_PATH . $opt . $filename;
1133
+                $filename = MODX_BASE_PATH.$opt.$filename;
1134 1134
 
1135 1135
                 if (is_file($filename)) {
1136 1136
                     clearstatcache();
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
                 }
1195 1195
                 break;
1196 1196
             case 'datagrid':
1197
-                include_once(MODX_MANAGER_PATH . 'includes/controls/datagrid.class.php');
1197
+                include_once(MODX_MANAGER_PATH.'includes/controls/datagrid.class.php');
1198 1198
                 $grd = new DataGrid(null, trim($value));
1199 1199
                 $grd->itemStyle = '';
1200 1200
                 $grd->altItemStyle = '';
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
         $value = $this->value;
1293 1293
         $opt = $this->opt;
1294 1294
 
1295
-        return include(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1295
+        return include(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1296 1296
     }
1297 1297
 
1298 1298
     public function getValueFromElement($key, $value, $cmd, $opt)
@@ -1308,13 +1308,13 @@  discard block
 block discarded – undo
1308 1308
                 $row = $modx->getDatabase()->getRow($result);
1309 1309
                 $php = $row['snippet'];
1310 1310
             } elseif ($total == 0) {
1311
-                $assets_path = MODX_BASE_PATH . 'assets/';
1312
-                if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) {
1313
-                    $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php";
1314
-                } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) {
1315
-                    $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php";
1316
-                } elseif (is_file(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1317
-                    $modifiers_path = MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1311
+                $assets_path = MODX_BASE_PATH.'assets/';
1312
+                if (is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) {
1313
+                    $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php";
1314
+                } elseif (is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) {
1315
+                    $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php";
1316
+                } elseif (is_file(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1317
+                    $modifiers_path = MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1318 1318
                 } else {
1319 1319
                     $modifiers_path = false;
1320 1320
                 }
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
                         $php = substr($php, 0, -2);
1333 1333
                     }
1334 1334
                     if ($this->elmName !== '') {
1335
-                        $modx->snippetCache[$this->elmName . 'Props'] = '';
1335
+                        $modx->snippetCache[$this->elmName.'Props'] = '';
1336 1336
                     }
1337 1337
                 } else {
1338 1338
                     $php = false;
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
             $custom = eval($php);
1370 1370
             $msg = ob_get_contents();
1371 1371
             if ($value === $this->bt) {
1372
-                $value = $msg . $custom;
1372
+                $value = $msg.$custom;
1373 1373
             }
1374 1374
             ob_end_clean();
1375 1375
         } elseif ($html !== false && isset($value) && $value !== '') {
@@ -1543,7 +1543,7 @@  discard block
 block discarded – undo
1543 1543
     public function ucfirst($str)
1544 1544
     {
1545 1545
         if (function_exists('mb_strtoupper')) {
1546
-            return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1546
+            return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1547 1547
         }
1548 1548
 
1549 1549
         return ucfirst($str);
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
     public function lcfirst($str)
1553 1553
     {
1554 1554
         if (function_exists('mb_strtolower')) {
1555
-            return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1555
+            return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1556 1556
         }
1557 1557
 
1558 1558
         return lcfirst($str);
Please login to merge, or discard this 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.