@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | * MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php" |
| 257 | 257 | * $extname - extension name in lowercase |
| 258 | 258 | * |
| 259 | - * @param $extname |
|
| 259 | + * @param string $extname |
|
| 260 | 260 | * @param bool $reload |
| 261 | 261 | * @return bool |
| 262 | 262 | */ |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | * @param int $count_attempts |
| 300 | 300 | * @param string $type $type |
| 301 | 301 | * @param string $responseCode |
| 302 | - * @return bool|null |
|
| 302 | + * @return false|null |
|
| 303 | 303 | * @global string $base_url |
| 304 | 304 | * @global string $site_url |
| 305 | 305 | */ |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | /** |
| 1004 | - * @param $contents |
|
| 1004 | + * @param string $contents |
|
| 1005 | 1005 | * @return mixed |
| 1006 | 1006 | */ |
| 1007 | 1007 | public function RecoveryEscapedTags($contents) |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | 1027 | /** |
| 1028 | - * @param $tstart |
|
| 1028 | + * @param double $tstart |
|
| 1029 | 1029 | * @return array |
| 1030 | 1030 | */ |
| 1031 | 1031 | public function getTimerStats($tstart) |
@@ -1777,7 +1777,7 @@ discard block |
||
| 1777 | 1777 | |
| 1778 | 1778 | /** |
| 1779 | 1779 | * Remove Comment-Tags from output like <!--@- Comment -@--> |
| 1780 | - * @param $content |
|
| 1780 | + * @param string $content |
|
| 1781 | 1781 | * @param string $left |
| 1782 | 1782 | * @param string $right |
| 1783 | 1783 | * @return mixed |
@@ -1950,7 +1950,7 @@ discard block |
||
| 1950 | 1950 | /** |
| 1951 | 1951 | * Run snippets as per the tags in $documentSource and replace the tags with the returned values. |
| 1952 | 1952 | * |
| 1953 | - * @param $content |
|
| 1953 | + * @param string $content |
|
| 1954 | 1954 | * @return string |
| 1955 | 1955 | * @internal param string $documentSource |
| 1956 | 1956 | */ |
@@ -2984,7 +2984,7 @@ discard block |
||
| 2984 | 2984 | |
| 2985 | 2985 | /** |
| 2986 | 2986 | * @param $templateID |
| 2987 | - * @return mixed |
|
| 2987 | + * @return string |
|
| 2988 | 2988 | */ |
| 2989 | 2989 | public function _getTemplateCodeFromDB($templateID) |
| 2990 | 2990 | { |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | /** |
| 3028 | 3028 | * @param $id |
| 3029 | 3029 | * @param int $top |
| 3030 | - * @return mixed |
|
| 3030 | + * @return string |
|
| 3031 | 3031 | */ |
| 3032 | 3032 | public function getUltimateParentId($id, $top = 0) |
| 3033 | 3033 | { |
@@ -3358,7 +3358,7 @@ discard block |
||
| 3358 | 3358 | * |
| 3359 | 3359 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3360 | 3360 | * @param int $id Element- / Resource-id |
| 3361 | - * @return bool |
|
| 3361 | + * @return false|null |
|
| 3362 | 3362 | */ |
| 3363 | 3363 | public function lockElement($type, $id) |
| 3364 | 3364 | { |
@@ -3380,7 +3380,7 @@ discard block |
||
| 3380 | 3380 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3381 | 3381 | * @param int $id Element- / Resource-id |
| 3382 | 3382 | * @param bool $includeAllUsers true = Deletes not only own user-locks |
| 3383 | - * @return bool |
|
| 3383 | + * @return false|null |
|
| 3384 | 3384 | */ |
| 3385 | 3385 | public function unlockElement($type, $id, $includeAllUsers = false) |
| 3386 | 3386 | { |
@@ -3488,7 +3488,7 @@ discard block |
||
| 3488 | 3488 | * @param array $params |
| 3489 | 3489 | * @param string $msg |
| 3490 | 3490 | * @param array $files |
| 3491 | - * @return mixed |
|
| 3491 | + * @return boolean |
|
| 3492 | 3492 | */ |
| 3493 | 3493 | public function sendmail($params = array(), $msg = '', $files = array()) |
| 3494 | 3494 | { |
@@ -3984,7 +3984,7 @@ discard block |
||
| 3984 | 3984 | * |
| 3985 | 3985 | * @param string $type |
| 3986 | 3986 | * @param bool $report |
| 3987 | - * @return bool |
|
| 3987 | + * @return boolean|null |
|
| 3988 | 3988 | */ |
| 3989 | 3989 | public function clearCache($type = '', $report = false) |
| 3990 | 3990 | { |
@@ -4351,7 +4351,7 @@ discard block |
||
| 4351 | 4351 | * - Placeholders prefix. Default: '{'. |
| 4352 | 4352 | * @param string $suffix {string} |
| 4353 | 4353 | * - Placeholders suffix. Default: '}'. |
| 4354 | - * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4354 | + * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4355 | 4355 | * - Parsed chunk or false if $chunkArr is not array. |
| 4356 | 4356 | */ |
| 4357 | 4357 | public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}') |
@@ -5327,7 +5327,7 @@ discard block |
||
| 5327 | 5327 | * Remove event listener - only for use within the current execution cycle |
| 5328 | 5328 | * |
| 5329 | 5329 | * @param string $evtName |
| 5330 | - * @return boolean |
|
| 5330 | + * @return false|null |
|
| 5331 | 5331 | */ |
| 5332 | 5332 | public function removeEventListener($evtName) |
| 5333 | 5333 | { |
@@ -5351,7 +5351,7 @@ discard block |
||
| 5351 | 5351 | * |
| 5352 | 5352 | * @param string $evtName |
| 5353 | 5353 | * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value. |
| 5354 | - * @return boolean|array |
|
| 5354 | + * @return false|null |
|
| 5355 | 5355 | */ |
| 5356 | 5356 | public function invokeEvent($evtName, $extParams = array()) |
| 5357 | 5357 | { |
@@ -5950,7 +5950,7 @@ discard block |
||
| 5950 | 5950 | |
| 5951 | 5951 | /** |
| 5952 | 5952 | * @param string $str |
| 5953 | - * @return bool|mixed|string |
|
| 5953 | + * @return string |
|
| 5954 | 5954 | */ |
| 5955 | 5955 | public function atBindFileContent($str = '') |
| 5956 | 5956 | { |
@@ -6001,8 +6001,8 @@ discard block |
||
| 6001 | 6001 | } |
| 6002 | 6002 | |
| 6003 | 6003 | /** |
| 6004 | - * @param $str |
|
| 6005 | - * @return bool|string |
|
| 6004 | + * @param string $str |
|
| 6005 | + * @return false|string |
|
| 6006 | 6006 | */ |
| 6007 | 6007 | public function getExtFromFilename($str) |
| 6008 | 6008 | { |
@@ -6030,7 +6030,7 @@ discard block |
||
| 6030 | 6030 | * @param string $text Error message |
| 6031 | 6031 | * @param string $file File where the error was detected |
| 6032 | 6032 | * @param string $line Line number within $file |
| 6033 | - * @return boolean |
|
| 6033 | + * @return boolean|null |
|
| 6034 | 6034 | */ |
| 6035 | 6035 | public function phpError($nr, $text, $file, $line) |
| 6036 | 6036 | { |
@@ -6082,7 +6082,7 @@ discard block |
||
| 6082 | 6082 | * @param string $text |
| 6083 | 6083 | * @param string $line |
| 6084 | 6084 | * @param string $output |
| 6085 | - * @return bool |
|
| 6085 | + * @return null|boolean |
|
| 6086 | 6086 | */ |
| 6087 | 6087 | public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') |
| 6088 | 6088 | { |
@@ -6504,7 +6504,7 @@ discard block |
||
| 6504 | 6504 | |
| 6505 | 6505 | /** |
| 6506 | 6506 | * @param string $str |
| 6507 | - * @return bool|mixed|string |
|
| 6507 | + * @return string |
|
| 6508 | 6508 | */ |
| 6509 | 6509 | public function atBindInclude($str = '') |
| 6510 | 6510 | { |
@@ -6555,7 +6555,7 @@ discard block |
||
| 6555 | 6555 | * @param $str |
| 6556 | 6556 | * @param int $flags |
| 6557 | 6557 | * @param string $encode |
| 6558 | - * @return mixed |
|
| 6558 | + * @return string |
|
| 6559 | 6559 | */ |
| 6560 | 6560 | public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '') |
| 6561 | 6561 | { |
@@ -6564,7 +6564,7 @@ discard block |
||
| 6564 | 6564 | } |
| 6565 | 6565 | |
| 6566 | 6566 | /** |
| 6567 | - * @param $string |
|
| 6567 | + * @param string $string |
|
| 6568 | 6568 | * @param bool $returnData |
| 6569 | 6569 | * @return bool|mixed |
| 6570 | 6570 | */ |
@@ -50,17 +50,23 @@ discard block |
||
| 50 | 50 | include_once($autoloader); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
| 53 | +if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
| 54 | + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
| 55 | +} |
|
| 54 | 56 | |
| 55 | 57 | $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
| 56 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
| 58 | +if(is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 57 | 59 | include_once($base_path . 'assets/cache/siteManager.php'); |
| 58 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
| 60 | +} |
|
| 61 | +if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
| 59 | 62 | define('MGR_DIR', 'manager'); |
| 60 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
| 63 | +} |
|
| 64 | +if(is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
| 61 | 65 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
| 62 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
| 66 | +} |
|
| 67 | +if(!defined('MODX_SITE_HOSTNAMES')) { |
|
| 63 | 68 | define('MODX_SITE_HOSTNAMES', ''); |
| 69 | +} |
|
| 64 | 70 | |
| 65 | 71 | // get start time |
| 66 | 72 | $mstart = memory_get_usage(); |
@@ -129,7 +135,7 @@ discard block |
||
| 129 | 135 | @ini_set("display_errors","0"); |
| 130 | 136 | } |
| 131 | 137 | |
| 132 | -if(MODX_CLI){ |
|
| 138 | +if(MODX_CLI) { |
|
| 133 | 139 | @set_time_limit(0); |
| 134 | 140 | @ini_set('max_execution_time',0); |
| 135 | 141 | } |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | /** |
| 7 | 7 | * @return string |
| 8 | 8 | */ |
| 9 | -function genEvoSessionName() |
|
| 10 | -{
|
|
| 9 | +function genEvoSessionName() |
|
| 10 | +{ |
|
| 11 | 11 | $_ = crc32(__FILE__); |
| 12 | 12 | $_ = sprintf('%u', $_);
|
| 13 | 13 | |
@@ -17,10 +17,12 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @return void |
| 19 | 19 | */ |
| 20 | -function startCMSSession() |
|
| 21 | -{
|
|
| 20 | +function startCMSSession() |
|
| 21 | +{ |
|
| 22 | 22 | global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; |
| 23 | - if(MODX_CLI) return; |
|
| 23 | + if(MODX_CLI) { |
|
| 24 | + return; |
|
| 25 | + } |
|
| 24 | 26 | |
| 25 | 27 | session_name($site_sessionname); |
| 26 | 28 | removeInvalidCmsSessionIds($site_sessionname); |
@@ -31,14 +33,14 @@ discard block |
||
| 31 | 33 | session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
| 32 | 34 | session_start(); |
| 33 | 35 | $key = "modx.mgr.session.cookie.lifetime"; |
| 34 | - if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
|
|
| 36 | + if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
|
| 35 | 37 | $cookieLifetime = (int)$_SESSION[$key]; |
| 36 | - if ($cookieLifetime) {
|
|
| 38 | + if ($cookieLifetime) { |
|
| 37 | 39 | $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
| 38 | 40 | } |
| 39 | 41 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
| 40 | 42 | } |
| 41 | - if (!isset($_SESSION['modx.session.created.time'])) {
|
|
| 43 | + if (!isset($_SESSION['modx.session.created.time'])) { |
|
| 42 | 44 | $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME']; |
| 43 | 45 | } |
| 44 | 46 | } |
@@ -48,9 +50,9 @@ discard block |
||
| 48 | 50 | * @param $session_name |
| 49 | 51 | * @return void |
| 50 | 52 | */ |
| 51 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) |
|
| 52 | -{
|
|
| 53 | - if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
|
|
| 53 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name) |
|
| 54 | +{ |
|
| 55 | + if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { |
|
| 54 | 56 | unset($storage[$session_name]); |
| 55 | 57 | } |
| 56 | 58 | } |
@@ -59,9 +61,11 @@ discard block |
||
| 59 | 61 | * @param $session_name |
| 60 | 62 | * @return void |
| 61 | 63 | */ |
| 62 | -function removeInvalidCmsSessionIds($session_name) |
|
| 63 | -{
|
|
| 64 | - if(MODX_CLI) return; |
|
| 64 | +function removeInvalidCmsSessionIds($session_name) |
|
| 65 | +{ |
|
| 66 | + if(MODX_CLI) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 65 | 69 | // session ids is invalid iff it is empty string |
| 66 | 70 | // storage priorioty can see in PHP source ext/session/session.c |
| 67 | 71 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |