@@ -144,33 +144,33 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -116,7 +116,8 @@ discard block |
||
| 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 |
||
| 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'])) { |
@@ -9,7 +9,7 @@ |
||
| 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; |
@@ -5,7 +5,7 @@ |
||
| 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; |
@@ -57,7 +57,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -279,7 +279,8 @@ discard block |
||
| 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 |
||
| 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) { |
@@ -9,7 +9,7 @@ |
||
| 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; |
@@ -5,7 +5,7 @@ |
||
| 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; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $this->portable_hashes = $portable_hashes; |
| 50 | 50 | |
| 51 | - $this->random_state = microtime() . uniqid(mt_rand(), true); |
|
| 51 | + $this->random_state = microtime().uniqid(mt_rand(), true); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $output = ''; |
| 69 | 69 | for ($i = 0; $i < $count; $i += 16) { |
| 70 | 70 | $this->random_state = |
| 71 | - md5(microtime() . $this->random_state); |
|
| 71 | + md5(microtime().$this->random_state); |
|
| 72 | 72 | $output .= |
| 73 | 73 | pack('H*', md5($this->random_state)); |
| 74 | 74 | } |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | // consequently in lower iteration counts and hashes that are |
| 161 | 161 | // quicker to crack (by non-PHP code). |
| 162 | 162 | |
| 163 | - $hash = md5($salt . $password, true); |
|
| 163 | + $hash = md5($salt.$password, true); |
|
| 164 | 164 | do { |
| 165 | - $hash = md5($hash . $password, true); |
|
| 165 | + $hash = md5($hash.$password, true); |
|
| 166 | 166 | } while (--$count); |
| 167 | 167 | |
| 168 | 168 | $output = substr($setting, 0, 12); |
@@ -118,16 +118,16 @@ discard block |
||
| 118 | 118 | for ($i = 0; $i < $tablevel; $i++) { |
| 119 | 119 | $tabs .= "\t"; |
| 120 | 120 | } |
| 121 | - $listhtml = $ordered == true ? $tabs . "<ol class='$ulroot'$typestr>\n" : $tabs . "<ul class='$ulroot'$typestr>\n"; |
|
| 121 | + $listhtml = $ordered == true ? $tabs."<ol class='$ulroot'$typestr>\n" : $tabs."<ul class='$ulroot'$typestr>\n"; |
|
| 122 | 122 | foreach ($array as $key => $value) { |
| 123 | 123 | if (is_array($value)) { |
| 124 | - $listhtml .= $tabs . "\t<li>" . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, |
|
| 125 | - $type, $ordered, $tablevel + 2) . $tabs . "\t</li>\n"; |
|
| 124 | + $listhtml .= $tabs."\t<li>".$key."\n".$this->makeList($value, $ulprefix.$ulroot, $ulprefix, |
|
| 125 | + $type, $ordered, $tablevel + 2).$tabs."\t</li>\n"; |
|
| 126 | 126 | } else { |
| 127 | - $listhtml .= $tabs . "\t<li>" . $value . "</li>\n"; |
|
| 127 | + $listhtml .= $tabs."\t<li>".$value."</li>\n"; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | - $listhtml .= $ordered == true ? $tabs . "</ol>\n" : $tabs . "</ul>\n"; |
|
| 130 | + $listhtml .= $ordered == true ? $tabs."</ol>\n" : $tabs."</ul>\n"; |
|
| 131 | 131 | |
| 132 | 132 | return $listhtml; |
| 133 | 133 | } |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | $msg = addslashes($modx->db->escape($msg)); |
| 299 | 299 | if (substr(strtolower($url), 0, 11) == "javascript:") { |
| 300 | 300 | $act = "__WebAlert();"; |
| 301 | - $fnc = "function __WebAlert(){" . substr($url, 11) . "};"; |
|
| 301 | + $fnc = "function __WebAlert(){".substr($url, 11)."};"; |
|
| 302 | 302 | } else { |
| 303 | - $act = ($url ? "window.location.href='" . addslashes($url) . "';" : ""); |
|
| 303 | + $act = ($url ? "window.location.href='".addslashes($url)."';" : ""); |
|
| 304 | 304 | } |
| 305 | 305 | $html = "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>"; |
| 306 | 306 | if ($modx->isFrontend()) { |
@@ -177,7 +177,8 @@ |
||
| 177 | 177 | * @return bool|string |
| 178 | 178 | */ |
| 179 | 179 | public function putChunk($chunkName) |
| 180 | - { // alias name >.< |
|
| 180 | + { |
|
| 181 | +// alias name >.< |
|
| 181 | 182 | global $modx; |
| 182 | 183 | |
| 183 | 184 | return $modx->getChunk($chunkName); |
@@ -9,6 +9,6 @@ |
||
| 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; |