Completed
Push — develop ( 0132ab...e45b08 )
by Dmytro
13:40 queued 05:11
created
manager/includes/extenders/ex_modifiers.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
     return true;
10 10
 }
11 11
 
12
-include_once(MODX_MANAGER_PATH . 'includes/extenders/modifiers.class.inc.php');
12
+include_once(MODX_MANAGER_PATH.'includes/extenders/modifiers.class.inc.php');
13 13
 $this->filter = new MODIFIERS;
14 14
 return true;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_managerapi.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:16
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') {
8
+if (!include_once MODX_MANAGER_PATH.'includes/extenders/manager.api.class.inc.php') {
9 9
     return false;
10 10
 } else {
11 11
     $this->manager = new ManagerAPI;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_modxmailer.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * Time: 14:17
7 7
  */
8 8
 
9
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')) {
9
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/modxmailer.class.inc.php')) {
10 10
     return false;
11 11
 } else {
12 12
     $this->mail = new MODxMailer;
Please login to merge, or discard this patch.
manager/includes/mutate_settings.ajax.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-require_once(dirname(__FILE__) . '/protect.inc.php');
9
+require_once(dirname(__FILE__).'/protect.inc.php');
10 10
 
11 11
 $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']);
12 12
 $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']);
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 
24 24
 switch (true) {
25 25
     case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',
26
-            $lang) && file_exists(dirname(__FILE__) . '/lang/' . $lang . '.inc.php')): {
27
-        include(dirname(__FILE__) . '/lang/' . $lang . '.inc.php');
26
+            $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')): {
27
+        include(dirname(__FILE__).'/lang/'.$lang.'.inc.php');
28 28
         $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : "";
29 29
         break;
30 30
     }
31 31
     case ($action == 'setsetting' && !empty($key) && !empty($value)): {
32
-        $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) VALUES('{$key}', '{$value}');";
32
+        $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) VALUES('{$key}', '{$value}');";
33 33
         $str = "true";
34 34
         $modx->db->query($sql);
35 35
         $emptyCache = true;
Please login to merge, or discard this patch.
manager/includes/rss.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 ---------------------------------------------- */
28 28
 
29 29
 // include MagPieRSS
30
-require_once(MODX_MANAGER_PATH . 'media/rss/rss_fetch.inc');
30
+require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc');
31 31
 /**
32 32
  * Convert relative path into absolute url
33 33
  *
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     $tmp = parse_url($base);
42 42
     extract($tmp);
43 43
     if (strpos($rel, "//") === 0) {
44
-        return $scheme . ':' . $rel;
44
+        return $scheme.':'.$rel;
45 45
     }
46 46
     // return if already absolute URL
47 47
     if (parse_url($rel, PHP_URL_SCHEME) != '') {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     }
50 50
     // queries and anchors
51 51
     if ($rel[0] == '#' || $rel[0] == '?') {
52
-        return $base . $rel;
52
+        return $base.$rel;
53 53
     }
54 54
     // remove non-directory element from path
55 55
     $path = preg_replace('#/[^/]*$#', '', $path);
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
         $path = '';
59 59
     }
60 60
     // dirty absolute URL
61
-    $abs = $host . $path . "/" . $rel;
61
+    $abs = $host.$path."/".$rel;
62 62
     // replace '//' or  '/./' or '/foo/../' with '/'
63 63
     $abs = preg_replace("/(\/\.?\/)/", "/", $abs);
64 64
     $abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs);
65 65
 
66 66
     // absolute URL is ready!
67
-    return $scheme . '://' . $abs;
67
+    return $scheme.'://'.$abs;
68 68
 }
69 69
 
70 70
 $feedData = array();
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     $output = '';
75 75
     $rss = @fetch_rss($url);
76 76
     if (!$rss) {
77
-        $feedData[$section] = 'Failed to retrieve ' . $url;
77
+        $feedData[$section] = 'Failed to retrieve '.$url;
78 78
         continue;
79 79
     }
80 80
     $output .= '<ul>';
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
         $description = strip_tags($item['description']);
89 89
         if (strlen($description) > 199) {
90 90
             $description = substr($description, 0, 200);
91
-            $description .= '...<br />Read <a href="' . $href . '" target="_blank">more</a>.';
91
+            $description .= '...<br />Read <a href="'.$href.'" target="_blank">more</a>.';
92 92
         }
93
-        $output .= '<li><a href="' . $href . '" target="_blank">' . $title . '</a> - <b>' . $pubdate . '</b><br />' . $description . '</li>';
93
+        $output .= '<li><a href="'.$href.'" target="_blank">'.$title.'</a> - <b>'.$pubdate.'</b><br />'.$description.'</li>';
94 94
     }
95 95
 
96 96
     $output .= '</ul>';
Please login to merge, or discard this patch.
manager/includes/categories.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     $newCat = $modx->db->escape($newCat);
35 35
     $cats = $modx->db->select('id', $modx->getFullTableName('categories'), "category='{$newCat}'");
36 36
     if ($cat = $modx->db->getValue($cats)) {
37
-        return (int)$cat;
37
+        return (int) $cat;
38 38
     }
39 39
 
40 40
     return 0;
Please login to merge, or discard this patch.
manager/processors/cache_sync.class.processor.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         if (isset($this->aliases[$id])) {
95 95
             if ($this->aliasVisible[$id] == 1) {
96 96
                 if ($path != '') {
97
-                    $path = $this->aliases[$id] . '/' . $path;
97
+                    $path = $this->aliases[$id].'/'.$path;
98 98
                 } else {
99 99
                     $path = $this->aliases[$id];
100 100
                 }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $modx->messageQuit("Cache path not set.");
119 119
         }
120 120
 
121
-        $files = glob(realpath($this->cachePath) . '/*.pageCache.php');
121
+        $files = glob(realpath($this->cachePath).'/*.pageCache.php');
122 122
         $filesincache = count($files);
123 123
         $deletedfiles = array();
124 124
         while ($file = array_shift($files)) {
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
                 if (isset($opcache)) {
152 152
                     echo '<p>Opcache empty.</p>';
153 153
                 }
154
-                echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>';
154
+                echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>';
155 155
                 foreach ($deletedfiles as $deletedfile) {
156
-                    echo '<li>' . $deletedfile . '</li>';
156
+                    echo '<li>'.$deletedfile.'</li>';
157 157
                 }
158 158
                 echo '</ul>';
159 159
             }
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
         // write the file
175
-        $content = '<?php' . "\n";
176
-        $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n";
177
-        $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n";
175
+        $content = '<?php'."\n";
176
+        $content .= '$recent_update=\''.$this->request_time.'\';'."\n";
177
+        $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n";
178 178
 
179
-        $filename = $this->cachePath . '/sitePublishing.idx.php';
179
+        $filename = $this->cachePath.'/sitePublishing.idx.php';
180 180
         if (!$handle = fopen($filename, 'w')) {
181 181
             exit("Cannot open file ({$filename}");
182 182
         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         $timesArr = array();
201 201
 
202 202
         $result = $modx->db->select('MIN(pub_date) AS minpub', '[+prefix+]site_content',
203
-            'pub_date>' . $this->request_time);
203
+            'pub_date>'.$this->request_time);
204 204
         if (!$result) {
205 205
             echo "Couldn't determine next publish event!";
206 206
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         }
212 212
 
213 213
         $result = $modx->db->select('MIN(unpub_date) AS minunpub', '[+prefix+]site_content',
214
-            'unpub_date>' . $this->request_time);
214
+            'unpub_date>'.$this->request_time);
215 215
         if (!$result) {
216 216
             echo "Couldn't determine next unpublish event!";
217 217
         }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $config = array();
251 251
         $content .= '$c=&$this->config;';
252 252
         while (list($key, $value) = $modx->db->getRow($rs, 'num')) {
253
-            $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";';
253
+            $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";';
254 254
             $config[$key] = $value;
255 255
         }
256 256
 
@@ -288,23 +288,23 @@  discard block
 block discarded – undo
288 288
             $docid = $doc['id'];
289 289
             if ($use_alias_path) {
290 290
                 $tmpPath = $this->getParents($doc['parent']);
291
-                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias'];
291
+                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias'];
292 292
                 $key = $alias;
293 293
             } else {
294 294
                 $key = $doc['alias'];
295 295
             }
296 296
 
297 297
             $doc['path'] = $tmpPath;
298
-            $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');';
299
-            $content .= '$d[\'' . $key . '\']=' . $docid . ';';
300
-            $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');';
298
+            $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');';
299
+            $content .= '$d[\''.$key.'\']='.$docid.';';
300
+            $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');';
301 301
         }
302 302
 
303 303
         // get content types
304 304
         $rs = $modx->db->select('id, contentType', '[+prefix+]site_content', "contentType!='text/html'");
305 305
         $content .= '$c=&$this->contentTypes;';
306 306
         while ($doc = $modx->db->getRow($rs)) {
307
-            $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';';
307
+            $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';';
308 308
         }
309 309
 
310 310
         // WRITE Chunks to cache file
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             if ($modx->config['minifyphp_incache']) {
315 315
                 $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']);
316 316
             }
317
-            $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';';
317
+            $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';';
318 318
         }
319 319
 
320 320
         // WRITE snippets to cache file
@@ -325,18 +325,18 @@  discard block
 block discarded – undo
325 325
         while ($row = $modx->db->getRow($rs)) {
326 326
             $key = $row['name'];
327 327
             if ($row['disabled']) {
328
-                $content .= '$s[\'' . $key . '\']=\'return false;\';';
328
+                $content .= '$s[\''.$key.'\']=\'return false;\';';
329 329
             } else {
330 330
                 $value = trim($row['snippet']);
331 331
                 if ($modx->config['minifyphp_incache']) {
332 332
                     $value = $this->php_strip_whitespace($value);
333 333
                 }
334
-                $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
334
+                $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
335 335
                 $properties = $modx->parseProperties($row['properties']);
336 336
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
337 337
                 $properties = array_merge($sharedproperties, $properties);
338 338
                 if (0 < count($properties)) {
339
-                    $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
339
+                    $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
340 340
                 }
341 341
             }
342 342
         }
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
             if ($modx->config['minifyphp_incache']) {
355 355
                 $value = $this->php_strip_whitespace($value);
356 356
             }
357
-            $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
357
+            $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
358 358
             if ($row['properties'] != '' || $row['sharedproperties'] != '') {
359 359
                 $properties = $modx->parseProperties($row['properties']);
360 360
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
361 361
                 $properties = array_merge($sharedproperties, $properties);
362 362
                 if (0 < count($properties)) {
363
-                    $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
363
+                    $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
364 364
                 }
365 365
             }
366 366
         }
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
         }
384 384
         foreach ($events as $evtname => $pluginnames) {
385 385
             $events[$evtname] = $pluginnames;
386
-            $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'',
387
-                    $this->escapeSingleQuotes($pluginnames)) . '\');';
386
+            $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'',
387
+                    $this->escapeSingleQuotes($pluginnames)).'\');';
388 388
         }
389 389
 
390 390
         $content .= "\n";
391 391
 
392 392
         // close and write the file
393
-        $filename = $this->cachePath . 'siteCache.idx.php';
393
+        $filename = $this->cachePath.'siteCache.idx.php';
394 394
 
395 395
         // invoke OnBeforeCacheUpdate event
396 396
         if ($modx) {
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
             exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!");
402 402
         }
403 403
 
404
-        if (!is_file($this->cachePath . '/.htaccess')) {
405
-            file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n");
404
+        if (!is_file($this->cachePath.'/.htaccess')) {
405
+            file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n");
406 406
         }
407 407
 
408 408
         // invoke OnCacheUpdate event
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 
425 425
         $source = trim($source);
426 426
         if (substr($source, 0, 5) !== '<?php') {
427
-            $source = '<?php ' . $source;
427
+            $source = '<?php '.$source;
428 428
         }
429 429
 
430 430
         $tokens = token_get_all($source);
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
             }
483 483
         }
484 484
         $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'),
485
-            array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_);
485
+            array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_);
486 486
         $source = trim($source);
487 487
 
488 488
         return $source;
Please login to merge, or discard this patch.
manager/processors/user_documents_permissions.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $role = $this->role;
37 37
 
38 38
         if ($role == 1) {
39
-            return true;  // administrator - grant all document permissions
39
+            return true; // administrator - grant all document permissions
40 40
         }
41 41
 
42 42
         if ($modx->config['use_udperms'] == 0 || $modx->config['use_udperms'] == "" || !isset($modx->config['use_udperms'])) {
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
             are private to the manager users will not be private to web users if the
64 64
             document group is not assigned to a web user group and visa versa.
65 65
          */
66
-        $permissionsok = false;  // set permissions to false
66
+        $permissionsok = false; // set permissions to false
67 67
 
68 68
         $rs = $modx->db->select(
69 69
             'count(DISTINCT sc.id)',
70 70
             "{$tblsc} AS sc 
71 71
 				LEFT JOIN {$tbldg} AS dg on dg.document = sc.id 
72 72
 				LEFT JOIN {$tbldgn} dgn ON dgn.id = dg.document_group",
73
-            "sc.id='{$this->document}' AND (" . (empty($docgrp) ? '' : "dg.document_group = " . $docgrp . " ||") . " sc.privatemgr = 0)"
73
+            "sc.id='{$this->document}' AND (".(empty($docgrp) ? '' : "dg.document_group = ".$docgrp." ||")." sc.privatemgr = 0)"
74 74
         );
75 75
         $limit = $modx->db->getValue($rs);
76 76
         if ($limit == 1) {
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 1 patch
Spacing   +10 added lines, -10 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
-if(!$modx->hasPermission('new_module')) {
5
+if (!$modx->hasPermission('new_module')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
  * @return string
18 18
  */
19 19
 function createGUID(){
20
-	srand((double)microtime()*1000000);
21
-	$r = rand() ;
22
-	$u = uniqid(getmypid() . $r . (double)microtime()*1000000,1);
23
-	$m = md5 ($u);
20
+	srand((double) microtime() * 1000000);
21
+	$r = rand();
22
+	$u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1);
23
+	$m = md5($u);
24 24
 	return $m;
25 25
 }
26 26
 
27 27
 // count duplicates
28 28
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'"));
29 29
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
30
-if($count>=1) $count = ' '.($count+1);
30
+if ($count >= 1) $count = ' '.($count + 1);
31 31
 else $count = '';
32 32
 
33 33
 // duplicate module
@@ -72,5 +72,5 @@  discard block
 block discarded – undo
72 72
 $_SESSION['itemname'] = $name;
73 73
 
74 74
 // finish duplicating - redirect to new module
75
-$header="Location: index.php?r=2&a=108&id=$newid";
75
+$header = "Location: index.php?r=2&a=108&id=$newid";
76 76
 header($header);
Please login to merge, or discard this patch.