Completed
Push — develop ( 5613ed...d17f77 )
by Maxim
11:03 queued 05:33
created
manager/includes/error.class.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@
 block discarded – undo
71 71
         }
72 72
 
73 73
         if ($context === 'common') {
74
-            $lang_path = MODX_MANAGER_PATH . 'includes/lang/';
74
+            $lang_path = MODX_MANAGER_PATH.'includes/lang/';
75 75
         } else {
76
-            $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/";
76
+            $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/";
77 77
         }
78
-        include_once($lang_path . 'english.inc.php');
78
+        include_once($lang_path.'english.inc.php');
79 79
         $manager_language = $modx->config['manager_language'];
80 80
         if (is_file("{$lang_path}{$manager_language}.inc.php")) {
81 81
             include_once("{$lang_path}{$manager_language}.inc.php");
Please login to merge, or discard this patch.
manager/includes/log.class.inc.php 1 patch
Spacing   +6 added lines, -6 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
         global $modx;
41 41
         $this->entry['msg'] = $msg; // writes testmessage to the object
42
-        $this->entry['action'] = empty($action) ? $modx->manager->action : $action;    // writes the action to the object
42
+        $this->entry['action'] = empty($action) ? $modx->manager->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
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
         $fields['message'] = $modx->db->escape($this->entry['msg']);
94 94
         $insert_id = $modx->db->insert($fields, $tbl_manager_log);
95 95
         if (!$insert_id) {
96
-            $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError());
96
+            $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError());
97 97
         } else {
98
-            $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000;
99
-            $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100;
98
+            $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000;
99
+            $trim = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100;
100 100
             if (($insert_id % $trim) === 0) {
101 101
                 $modx->rotate_log('manager_log', $limit, $trim);
102 102
             }
Please login to merge, or discard this patch.
manager/includes/extenders/ex_dbapi.inc.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 
12 12
 $out = false;
13 13
 $class = 'DBAPI';
14
-if( ! class_exists($class)){
15
-    include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php';
14
+if (!class_exists($class)) {
15
+    include_once MODX_MANAGER_PATH.'includes/extenders/dbapi.'.$database_type.'.class.inc.php';
16 16
 }
17 17
 
18
-if(class_exists($class)){
19
-    $this->db= new $class;
18
+if (class_exists($class)) {
19
+    $this->db = new $class;
20 20
     $out = true;
21 21
 }
22 22
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,17 @@
 block discarded – undo
7 7
 
8 8
 global $database_type;
9 9
 
10
-if (empty($database_type)) $database_type = 'mysql';
10
+if (empty($database_type)) {
11
+    $database_type = 'mysql';
12
+}
11 13
 
12 14
 $out = false;
13 15
 $class = 'DBAPI';
14
-if( ! class_exists($class)){
16
+if( ! class_exists($class)) {
15 17
     include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php';
16 18
 }
17 19
 
18
-if(class_exists($class)){
20
+if(class_exists($class)) {
19 21
     $this->db= new $class;
20 22
     $out = true;
21 23
 }
Please login to merge, or discard this patch.
manager/includes/extenders/manager.api.class.inc.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -144,33 +144,33 @@  discard block
 block discarded – undo
144 144
             $algorithm = 'UNCRYPT';
145 145
         }
146 146
 
147
-        $salt = md5($password . $seed);
147
+        $salt = md5($password.$seed);
148 148
 
149 149
         switch ($algorithm) {
150 150
             case 'BLOWFISH_Y':
151
-                $salt = '$2y$07$' . substr($salt, 0, 22);
151
+                $salt = '$2y$07$'.substr($salt, 0, 22);
152 152
                 break;
153 153
             case 'BLOWFISH_A':
154
-                $salt = '$2a$07$' . substr($salt, 0, 22);
154
+                $salt = '$2a$07$'.substr($salt, 0, 22);
155 155
                 break;
156 156
             case 'SHA512':
157
-                $salt = '$6$' . substr($salt, 0, 16);
157
+                $salt = '$6$'.substr($salt, 0, 16);
158 158
                 break;
159 159
             case 'SHA256':
160
-                $salt = '$5$' . substr($salt, 0, 16);
160
+                $salt = '$5$'.substr($salt, 0, 16);
161 161
                 break;
162 162
             case 'MD5':
163
-                $salt = '$1$' . substr($salt, 0, 8);
163
+                $salt = '$1$'.substr($salt, 0, 8);
164 164
                 break;
165 165
         }
166 166
 
167 167
         if ($algorithm !== 'UNCRYPT') {
168
-            $password = sha1($password) . crypt($password, $salt);
168
+            $password = sha1($password).crypt($password, $salt);
169 169
         } else {
170
-            $password = sha1($salt . $password);
170
+            $password = sha1($salt.$password);
171 171
         }
172 172
 
173
-        $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8);
173
+        $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8);
174 174
 
175 175
         return $result;
176 176
     }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         $check_files = explode("\n", $check_files);
253 253
         foreach ($check_files as $file) {
254 254
             $file = trim($file);
255
-            $file = MODX_BASE_PATH . $file;
255
+            $file = MODX_BASE_PATH.$file;
256 256
             if (!is_file($file)) {
257 257
                 continue;
258 258
             }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         $checksum = unserialize($checksum);
276 276
         foreach ($check_files as $file) {
277 277
             $file = trim($file);
278
-            $filePath = MODX_BASE_PATH . $file;
278
+            $filePath = MODX_BASE_PATH.$file;
279 279
             if (!is_file($filePath)) {
280 280
                 continue;
281 281
             }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     {
295 295
         global $modx;
296 296
         $tbl_system_settings = $modx->getFullTableName('system_settings');
297
-        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->db->escape($checksum) . "')";
297
+        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->db->escape($checksum)."')";
298 298
         $modx->db->query($sql);
299 299
     }
300 300
 
@@ -371,10 +371,10 @@  discard block
 block discarded – undo
371 371
             foreach ($settings as $key => $val) {
372 372
                 $f = array();
373 373
                 $f['user'] = $_SESSION['mgrInternalKey'];
374
-                $f['setting_name'] = '_LAST_' . $key;
374
+                $f['setting_name'] = '_LAST_'.$key;
375 375
                 $f['setting_value'] = $val;
376 376
                 $f = $modx->db->escape($f);
377
-                $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')";
377
+                $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')";
378 378
                 $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)";
379 379
                 $modx->db->insert($f, $modx->getFullTableName('user_settings'));
380 380
             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,8 @@  discard block
 block discarded – undo
116 116
      * @return string
117 117
      */
118 118
     public function getHashType($db_value = '')
119
-    { // md5 | v1 | phpass
119
+    {
120
+// md5 | v1 | phpass
120 121
         $c = substr($db_value, 0, 1);
121 122
         if ($c === '$') {
122 123
             return 'phpass';
@@ -135,7 +136,8 @@  discard block
 block discarded – undo
135 136
      * @return string
136 137
      */
137 138
     public function genV1Hash($password, $seed = '1')
138
-    { // $seed is user_id basically
139
+    {
140
+// $seed is user_id basically
139 141
         global $modx;
140 142
 
141 143
         if (isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) {
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpcompat.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')) {
12
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpcompat.class.inc.php')) {
13 13
     return false;
14 14
 } else {
15 15
     $this->phpcompat = new PHPCOMPAT;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_export_site.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:24
6 6
  */
7 7
 
8
-if (include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) {
8
+if (include_once(MODX_MANAGER_PATH.'includes/extenders/export.class.inc.php')) {
9 9
     $this->export = new EXPORT_SITE;
10 10
 
11 11
     return true;
Please login to merge, or discard this patch.
manager/includes/extenders/export.class.inc.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $this->count = 0;
58 58
         $this->setUrlMode();
59 59
         $this->generate_mode = 'crawl';
60
-        $this->targetDir = $modx->config['base_path'] . 'temp/export';
60
+        $this->targetDir = $modx->config['base_path'].'temp/export';
61 61
         if (!isset($this->total)) {
62 62
             $this->getTotal();
63 63
         }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         $ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids)));
114 114
         if (count($ignore_ids) > 0) {
115
-            $ignore_ids = "AND NOT id IN ('" . implode("','", $ignore_ids) . "')";
115
+            $ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')";
116 116
         } else {
117 117
             $ignore_ids = '';
118 118
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $noncache = ($noncache == 1) ? '' : 'AND cacheable=1';
123 123
         $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}";
124 124
         $rs = $modx->db->select('count(id)', $tbl_site_content, $where);
125
-        $this->total = (int)$modx->db->getValue($rs);
125
+        $this->total = (int) $modx->db->getValue($rs);
126 126
 
127 127
         return $this->total;
128 128
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         } elseif (!is_readable($directory)) {
152 152
             return $rs;
153 153
         } else {
154
-            $files = glob($directory . '/*');
154
+            $files = glob($directory.'/*');
155 155
             if (!empty($files)) {
156 156
                 foreach ($files as $path) {
157 157
                     $rs = is_dir($path) ? $this->removeDirectoryAll($path) : unlink($path);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
             $_lang = $back_lang;
182 182
         } else {
183
-            $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}");
183
+            $src = $this->curl_get_contents(MODX_SITE_URL."index.php?id={$docid}");
184 184
         }
185 185
 
186 186
 
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
         global $modx;
216 216
 
217 217
         if ($alias === '') {
218
-            $filename = $prefix . $docid . $suffix;
218
+            $filename = $prefix.$docid.$suffix;
219 219
         } else {
220 220
             if ($modx->config['suffix_mode'] === '1' && strpos($alias, '.') !== false) {
221 221
                 $suffix = '';
222 222
             }
223
-            $filename = $prefix . $alias . $suffix;
223
+            $filename = $prefix.$alias.$suffix;
224 224
         }
225 225
 
226 226
         return $filename;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $tbl_site_content = $modx->getFullTableName('site_content');
239 239
 
240 240
         $ignore_ids = $this->ignore_ids;
241
-        $dirpath = $this->targetDir . '/';
241
+        $dirpath = $this->targetDir.'/';
242 242
 
243 243
         $prefix = $modx->config['friendly_url_prefix'];
244 244
         $suffix = $modx->config['friendly_url_suffix'];
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
         $ph['status'] = 'fail';
250 250
         $ph['msg1'] = $_lang['export_site_failed'];
251
-        $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath;
251
+        $ph['msg2'] = $_lang["export_site_failed_no_write"].' - '.$dirpath;
252 252
         $msg_failed_no_write = $this->parsePlaceholder($tpl, $ph);
253 253
 
254 254
         $ph['msg2'] = $_lang["export_site_failed_no_retrieve"];
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
             if (!$row['wasNull']) { // needs writing a document
283 283
                 $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix);
284
-                $filename = $dirpath . $docname;
284
+                $filename = $dirpath.$docname;
285 285
                 if (!is_file($filename)) {
286 286
                     if ($row['published'] === '1') {
287 287
                         $status = $this->makeFile($row['id'], $filename);
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'],
310 310
                         '.') === false)) { // needs making a folder
311 311
                 $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id'];
312
-                $dir_path = $dirpath . $end_dir;
312
+                $dir_path = $dirpath.$end_dir;
313 313
                 if (strpos($dir_path, MODX_BASE_PATH) === false) {
314 314
                     return false;
315 315
                 }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
                 if ($modx->config['make_folders'] === '1' && $row['published'] === '1') {
327 327
                     if (!empty($filename) && is_file($filename)) {
328
-                        rename($filename, $dir_path . '/index.html');
328
+                        rename($filename, $dir_path.'/index.html');
329 329
                     }
330 330
                 }
331 331
                 $this->targetDir = $dir_path;
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
 
350 350
         $ch = curl_init();
351 351
         curl_setopt($ch, CURLOPT_URL, $url);
352
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);    // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT
353
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);    // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER
352
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT
353
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER
354 354
         curl_setopt($ch, CURLOPT_HEADER, false);
355 355
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
356 356
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -279,7 +279,8 @@  discard block
 block discarded – undo
279 279
             $row['count'] = $this->count;
280 280
             $row['url'] = $modx->makeUrl($row['id']);
281 281
 
282
-            if (!$row['wasNull']) { // needs writing a document
282
+            if (!$row['wasNull']) {
283
+// needs writing a document
283 284
                 $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix);
284 285
                 $filename = $dirpath . $docname;
285 286
                 if (!is_file($filename)) {
@@ -307,7 +308,8 @@  discard block
 block discarded – undo
307 308
                 $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row);
308 309
             }
309 310
             if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'],
310
-                        '.') === false)) { // needs making a folder
311
+                        '.') === false)) {
312
+// needs making a folder
311 313
                 $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id'];
312 314
                 $dir_path = $dirpath . $end_dir;
313 315
                 if (strpos($dir_path, MODX_BASE_PATH) === false) {
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpass.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')) {
12
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpass.class.inc.php')) {
13 13
     return false;
14 14
 } else {
15 15
     $this->phpass = new PasswordHash;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_maketable.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:38
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php') {
8
+if (!include_once MODX_MANAGER_PATH.'includes/extenders/maketable.class.php') {
9 9
     return false;
10 10
 } else {
11 11
     $this->table = new MakeTable;
Please login to merge, or discard this patch.