@@ -5,133 +5,133 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // action list |
| 7 | 7 | $GLOBALS['action_list'] = array( |
| 8 | - '1' => 'Loading a frame(set)', |
|
| 9 | - '2' => 'Viewing home page/ online users', |
|
| 10 | - '3' => 'Viewing data for resource', |
|
| 11 | - '4' => 'Creating a resource', |
|
| 12 | - '5' => 'Saving resource', |
|
| 13 | - '6' => 'Deleting resource', |
|
| 14 | - '7' => 'Waiting while MODX cleans up', |
|
| 15 | - '8' => 'Logged out', |
|
| 16 | - '9' => 'Viewing help', |
|
| 17 | - '10' => 'Viewing/ composing messages', |
|
| 18 | - '11' => 'Creating a user', |
|
| 19 | - '12' => 'Editing user', |
|
| 20 | - '13' => 'Viewing logging', |
|
| 21 | - '14' => 'Editing a parser', |
|
| 22 | - '15' => 'Saving a parser', |
|
| 23 | - '16' => 'Editing template', |
|
| 24 | - '17' => 'Editing settings', |
|
| 25 | - '18' => 'Viewing Credits :)', |
|
| 26 | - '19' => 'Creating a new template', |
|
| 27 | - '20' => 'Saving template', |
|
| 28 | - '21' => 'Deleting template', |
|
| 29 | - '22' => 'Editing Snippet', |
|
| 30 | - '23' => 'Creating a new Snippet', |
|
| 31 | - '24' => 'Saving Snippet', |
|
| 32 | - '25' => 'Deleting Snippet', |
|
| 33 | - '26' => 'Refreshing site', |
|
| 34 | - '27' => 'Editing resource', |
|
| 35 | - '28' => 'Changing password', |
|
| 36 | - '29' => 'Error', |
|
| 37 | - '30' => 'Saving settings', |
|
| 38 | - '31' => 'Using file manager', |
|
| 39 | - '32' => 'Saving user', |
|
| 40 | - '33' => 'Deleting user', |
|
| 41 | - '34' => 'Saving new password', |
|
| 42 | - '35' => 'Editing role', |
|
| 43 | - '36' => 'Saving role', |
|
| 44 | - '37' => 'Deleting role', |
|
| 45 | - '38' => 'Creating new role', |
|
| 46 | - '40' => 'Editing Access Permissions', |
|
| 47 | - '41' => 'Editing Access Permissions', |
|
| 48 | - '42' => 'Editing Access Permissions', |
|
| 49 | - '43' => 'Editing Access Permissions', |
|
| 50 | - '44' => 'Editing Access Permissions', |
|
| 51 | - '45' => 'Idle', |
|
| 52 | - '46' => 'Editing Access Permissions', |
|
| 53 | - '47' => 'Editing Access Permissions', |
|
| 54 | - '48' => 'Editing Access Permissions', |
|
| 55 | - '49' => 'Editing Access Permissions', |
|
| 56 | - '50' => 'Editing Access Permissions', |
|
| 57 | - '51' => 'Moving resource', |
|
| 58 | - '52' => 'Moved resource', |
|
| 59 | - '53' => 'Viewing system info', |
|
| 60 | - '54' => 'Optimizing a table', |
|
| 61 | - '55' => 'Empty logs', |
|
| 62 | - '56' => 'Refresh resource tree', |
|
| 63 | - '57' => 'Refresh menu', |
|
| 64 | - '58' => 'Logged in', |
|
| 65 | - '59' => 'About MODX', |
|
| 66 | - '60' => 'Emptying Recycle Bin', |
|
| 67 | - '61' => 'Publishing a resource', |
|
| 68 | - '62' => 'Un-publishing a resource', |
|
| 69 | - '63' => 'Un-deleting a resource', |
|
| 70 | - '64' => 'Removing deleted content', |
|
| 71 | - '65' => 'Deleting a message', |
|
| 72 | - '66' => 'Sending a message', |
|
| 73 | - '67' => 'Removing locks', |
|
| 74 | - '68' => 'Viewing site logging', |
|
| 75 | - '69' => 'Viewing online visitors', |
|
| 76 | - '70' => 'Viewing site schedule', |
|
| 77 | - '71' => 'Searching', |
|
| 78 | - '72' => 'Adding a weblink', |
|
| 79 | - '73' => 'Editing a weblink', |
|
| 80 | - //case "74" : return "Changing personal preferences"; break; |
|
| 81 | - '75' => 'User/ role management', |
|
| 82 | - '76' => 'Element management', |
|
| 83 | - '77' => 'Creating a new Chunk (HTML Snippet)', |
|
| 84 | - '78' => 'Editing Chunk (HTML Snippet)', |
|
| 85 | - '79' => 'Saving Chunk (HTML Snippet)', |
|
| 86 | - '80' => 'Deleting Chunk (HTML Snippet)', |
|
| 87 | - '83' => 'Exporting a resource to HTML', |
|
| 88 | - '84' => 'Load Element Selector', |
|
| 89 | - '85' => 'Create Folder', |
|
| 90 | - '86' => 'Role management', |
|
| 91 | - '87' => 'Create new web user', |
|
| 92 | - '88' => 'Editing web user', |
|
| 93 | - '89' => 'Saving web user', |
|
| 94 | - '90' => 'Deleting web user', |
|
| 95 | - '91' => 'Editing Web Access Permissions', |
|
| 96 | - '92' => 'Editing Access Permissions', |
|
| 97 | - '93' => 'Backup Manager', |
|
| 98 | - '94' => 'Duplicate resource', |
|
| 99 | - '95' => 'Importing resources from HTML', |
|
| 100 | - '96' => 'Duplicate Template', |
|
| 101 | - '97' => 'Duplicate Chunk (HTML Snippet)', |
|
| 102 | - '98' => 'Duplicate Snippet', |
|
| 103 | - '99' => 'Manage Web Users', |
|
| 104 | - '100' => 'Previewing resource', |
|
| 105 | - '101' => 'Create new plugin', |
|
| 106 | - '102' => 'Edit plugin', |
|
| 107 | - '103' => 'Saving plugin', |
|
| 108 | - '104' => 'Delete plugin', |
|
| 109 | - '105' => 'Duplicate plugin', |
|
| 110 | - '106' => 'Viewing Modules', |
|
| 111 | - '107' => 'Create new module', |
|
| 112 | - '108' => 'Edit module', |
|
| 113 | - '109' => 'Saving module', |
|
| 114 | - '110' => 'Delete module', |
|
| 115 | - '111' => 'Duplicate module', |
|
| 116 | - '112' => 'Execute module', |
|
| 117 | - '113' => 'Manage module dependencies', |
|
| 118 | - '114' => 'View event log', |
|
| 119 | - '115' => 'View event log details', |
|
| 120 | - '116' => 'Delete event log', |
|
| 121 | - '117' => 'Editing tv rank', |
|
| 122 | - '118' => 'Call settings ajax include', |
|
| 123 | - '119' => 'Login Fail (Temporary Block)', |
|
| 8 | + '1' => 'Loading a frame(set)', |
|
| 9 | + '2' => 'Viewing home page/ online users', |
|
| 10 | + '3' => 'Viewing data for resource', |
|
| 11 | + '4' => 'Creating a resource', |
|
| 12 | + '5' => 'Saving resource', |
|
| 13 | + '6' => 'Deleting resource', |
|
| 14 | + '7' => 'Waiting while MODX cleans up', |
|
| 15 | + '8' => 'Logged out', |
|
| 16 | + '9' => 'Viewing help', |
|
| 17 | + '10' => 'Viewing/ composing messages', |
|
| 18 | + '11' => 'Creating a user', |
|
| 19 | + '12' => 'Editing user', |
|
| 20 | + '13' => 'Viewing logging', |
|
| 21 | + '14' => 'Editing a parser', |
|
| 22 | + '15' => 'Saving a parser', |
|
| 23 | + '16' => 'Editing template', |
|
| 24 | + '17' => 'Editing settings', |
|
| 25 | + '18' => 'Viewing Credits :)', |
|
| 26 | + '19' => 'Creating a new template', |
|
| 27 | + '20' => 'Saving template', |
|
| 28 | + '21' => 'Deleting template', |
|
| 29 | + '22' => 'Editing Snippet', |
|
| 30 | + '23' => 'Creating a new Snippet', |
|
| 31 | + '24' => 'Saving Snippet', |
|
| 32 | + '25' => 'Deleting Snippet', |
|
| 33 | + '26' => 'Refreshing site', |
|
| 34 | + '27' => 'Editing resource', |
|
| 35 | + '28' => 'Changing password', |
|
| 36 | + '29' => 'Error', |
|
| 37 | + '30' => 'Saving settings', |
|
| 38 | + '31' => 'Using file manager', |
|
| 39 | + '32' => 'Saving user', |
|
| 40 | + '33' => 'Deleting user', |
|
| 41 | + '34' => 'Saving new password', |
|
| 42 | + '35' => 'Editing role', |
|
| 43 | + '36' => 'Saving role', |
|
| 44 | + '37' => 'Deleting role', |
|
| 45 | + '38' => 'Creating new role', |
|
| 46 | + '40' => 'Editing Access Permissions', |
|
| 47 | + '41' => 'Editing Access Permissions', |
|
| 48 | + '42' => 'Editing Access Permissions', |
|
| 49 | + '43' => 'Editing Access Permissions', |
|
| 50 | + '44' => 'Editing Access Permissions', |
|
| 51 | + '45' => 'Idle', |
|
| 52 | + '46' => 'Editing Access Permissions', |
|
| 53 | + '47' => 'Editing Access Permissions', |
|
| 54 | + '48' => 'Editing Access Permissions', |
|
| 55 | + '49' => 'Editing Access Permissions', |
|
| 56 | + '50' => 'Editing Access Permissions', |
|
| 57 | + '51' => 'Moving resource', |
|
| 58 | + '52' => 'Moved resource', |
|
| 59 | + '53' => 'Viewing system info', |
|
| 60 | + '54' => 'Optimizing a table', |
|
| 61 | + '55' => 'Empty logs', |
|
| 62 | + '56' => 'Refresh resource tree', |
|
| 63 | + '57' => 'Refresh menu', |
|
| 64 | + '58' => 'Logged in', |
|
| 65 | + '59' => 'About MODX', |
|
| 66 | + '60' => 'Emptying Recycle Bin', |
|
| 67 | + '61' => 'Publishing a resource', |
|
| 68 | + '62' => 'Un-publishing a resource', |
|
| 69 | + '63' => 'Un-deleting a resource', |
|
| 70 | + '64' => 'Removing deleted content', |
|
| 71 | + '65' => 'Deleting a message', |
|
| 72 | + '66' => 'Sending a message', |
|
| 73 | + '67' => 'Removing locks', |
|
| 74 | + '68' => 'Viewing site logging', |
|
| 75 | + '69' => 'Viewing online visitors', |
|
| 76 | + '70' => 'Viewing site schedule', |
|
| 77 | + '71' => 'Searching', |
|
| 78 | + '72' => 'Adding a weblink', |
|
| 79 | + '73' => 'Editing a weblink', |
|
| 80 | + //case "74" : return "Changing personal preferences"; break; |
|
| 81 | + '75' => 'User/ role management', |
|
| 82 | + '76' => 'Element management', |
|
| 83 | + '77' => 'Creating a new Chunk (HTML Snippet)', |
|
| 84 | + '78' => 'Editing Chunk (HTML Snippet)', |
|
| 85 | + '79' => 'Saving Chunk (HTML Snippet)', |
|
| 86 | + '80' => 'Deleting Chunk (HTML Snippet)', |
|
| 87 | + '83' => 'Exporting a resource to HTML', |
|
| 88 | + '84' => 'Load Element Selector', |
|
| 89 | + '85' => 'Create Folder', |
|
| 90 | + '86' => 'Role management', |
|
| 91 | + '87' => 'Create new web user', |
|
| 92 | + '88' => 'Editing web user', |
|
| 93 | + '89' => 'Saving web user', |
|
| 94 | + '90' => 'Deleting web user', |
|
| 95 | + '91' => 'Editing Web Access Permissions', |
|
| 96 | + '92' => 'Editing Access Permissions', |
|
| 97 | + '93' => 'Backup Manager', |
|
| 98 | + '94' => 'Duplicate resource', |
|
| 99 | + '95' => 'Importing resources from HTML', |
|
| 100 | + '96' => 'Duplicate Template', |
|
| 101 | + '97' => 'Duplicate Chunk (HTML Snippet)', |
|
| 102 | + '98' => 'Duplicate Snippet', |
|
| 103 | + '99' => 'Manage Web Users', |
|
| 104 | + '100' => 'Previewing resource', |
|
| 105 | + '101' => 'Create new plugin', |
|
| 106 | + '102' => 'Edit plugin', |
|
| 107 | + '103' => 'Saving plugin', |
|
| 108 | + '104' => 'Delete plugin', |
|
| 109 | + '105' => 'Duplicate plugin', |
|
| 110 | + '106' => 'Viewing Modules', |
|
| 111 | + '107' => 'Create new module', |
|
| 112 | + '108' => 'Edit module', |
|
| 113 | + '109' => 'Saving module', |
|
| 114 | + '110' => 'Delete module', |
|
| 115 | + '111' => 'Duplicate module', |
|
| 116 | + '112' => 'Execute module', |
|
| 117 | + '113' => 'Manage module dependencies', |
|
| 118 | + '114' => 'View event log', |
|
| 119 | + '115' => 'View event log details', |
|
| 120 | + '116' => 'Delete event log', |
|
| 121 | + '117' => 'Editing tv rank', |
|
| 122 | + '118' => 'Call settings ajax include', |
|
| 123 | + '119' => 'Login Fail (Temporary Block)', |
|
| 124 | 124 | |
| 125 | - '300' => 'Create Template Variable', |
|
| 126 | - '301' => 'Edit Template Variable', |
|
| 127 | - '302' => 'Save Template Variable', |
|
| 128 | - '303' => 'Delete Template Variable', |
|
| 129 | - '304' => 'Duplicate Template Variable', |
|
| 125 | + '300' => 'Create Template Variable', |
|
| 126 | + '301' => 'Edit Template Variable', |
|
| 127 | + '302' => 'Save Template Variable', |
|
| 128 | + '303' => 'Delete Template Variable', |
|
| 129 | + '304' => 'Duplicate Template Variable', |
|
| 130 | 130 | |
| 131 | - '200' => 'Viewing phpInfo()', |
|
| 132 | - '501' => 'Delete category', |
|
| 133 | - '998' => 'Viewing web page', |
|
| 134 | - '999' => 'Viewing test page', |
|
| 131 | + '200' => 'Viewing phpInfo()', |
|
| 132 | + '501' => 'Delete category', |
|
| 133 | + '998' => 'Viewing web page', |
|
| 134 | + '999' => 'Viewing test page', |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -140,10 +140,10 @@ discard block |
||
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | 142 | function getAction($actionId, $itemid='') { |
| 143 | - global $action_list; |
|
| 143 | + global $action_list; |
|
| 144 | 144 | |
| 145 | - $ret = sprintf($action_list[$actionId], $itemid); |
|
| 146 | - if (!$ret) $ret = "Idle (unknown)"; |
|
| 145 | + $ret = sprintf($action_list[$actionId], $itemid); |
|
| 146 | + if (!$ret) $ret = "Idle (unknown)"; |
|
| 147 | 147 | |
| 148 | - return $ret; |
|
| 148 | + return $ret; |
|
| 149 | 149 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 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 | 5 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param string $itemid |
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | -function getAction($actionId, $itemid='') { |
|
| 142 | +function getAction($actionId, $itemid = ''){ |
|
| 143 | 143 | global $action_list; |
| 144 | 144 | |
| 145 | 145 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -139,11 +139,14 @@ |
||
| 139 | 139 | * @param string $itemid |
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | -function getAction($actionId, $itemid='') { |
|
| 142 | +function getAction($actionId, $itemid='') |
|
| 143 | +{ |
|
| 143 | 144 | global $action_list; |
| 144 | 145 | |
| 145 | 146 | $ret = sprintf($action_list[$actionId], $itemid); |
| 146 | - if (!$ret) $ret = "Idle (unknown)"; |
|
| 147 | + if (!$ret) { |
|
| 148 | + $ret = "Idle (unknown)"; |
|
| 149 | + } |
|
| 147 | 150 | |
| 148 | 151 | return $ret; |
| 149 | 152 | } |
@@ -11,12 +11,12 @@ |
||
| 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 | |
@@ -7,15 +7,17 @@ |
||
| 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 | } |
@@ -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; |
@@ -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) { |
@@ -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 | $modx = evolutionCMS(); |
| 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); |
@@ -373,7 +373,8 @@ discard block |
||
| 373 | 373 | * @return bool|mixed|mysqli_result |
| 374 | 374 | */ |
| 375 | 375 | public function save($fields, $table, $where = '') |
| 376 | - { // This is similar to "replace into table". |
|
| 376 | + { |
|
| 377 | +// This is similar to "replace into table". |
|
| 377 | 378 | |
| 378 | 379 | if ($where === '') { |
| 379 | 380 | $mode = 'insert'; |
@@ -490,7 +491,7 @@ discard block |
||
| 490 | 491 | { |
| 491 | 492 | $out = false; |
| 492 | 493 | if ($ds instanceof mysqli_result) { |
| 493 | - switch($mode){ |
|
| 494 | + switch($mode) { |
|
| 494 | 495 | case 'assoc': |
| 495 | 496 | $out = $ds->fetch_assoc(); |
| 496 | 497 | break; |
@@ -225,13 +225,13 @@ discard block |
||
| 225 | 225 | $orderBy = trim($orderBy); |
| 226 | 226 | $limit = trim($limit); |
| 227 | 227 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
| 228 | - $where = "WHERE {$where}"; |
|
| 228 | + $where = "where {$where}"; |
|
| 229 | 229 | } |
| 230 | 230 | if ($orderBy !== '' && stripos($orderBy, 'ORDER BY') !== 0) { |
| 231 | 231 | $orderBy = "ORDER BY {$orderBy}"; |
| 232 | 232 | } |
| 233 | 233 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
| 234 | - $limit = "LIMIT {$limit}"; |
|
| 234 | + $limit = "limit {$limit}"; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $out = $this->query("DELETE FROM {$from} {$where} {$orderBy} {$limit}"); |
@@ -272,16 +272,16 @@ discard block |
||
| 272 | 272 | $orderBy = trim($orderBy); |
| 273 | 273 | $limit = trim($limit); |
| 274 | 274 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
| 275 | - $where = "WHERE {$where}"; |
|
| 275 | + $where = "where {$where}"; |
|
| 276 | 276 | } |
| 277 | 277 | if ($orderBy !== '' && stripos($orderBy, 'ORDER') !== 0) { |
| 278 | 278 | $orderBy = "ORDER BY {$orderBy}"; |
| 279 | 279 | } |
| 280 | 280 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
| 281 | - $limit = "LIMIT {$limit}"; |
|
| 281 | + $limit = "limit {$limit}"; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderBy} {$limit}"); |
|
| 284 | + return $this->query("select {$fields} FROM {$from} {$where} {$orderBy} {$limit}"); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /** |
@@ -349,10 +349,10 @@ discard block |
||
| 349 | 349 | $where = trim($where); |
| 350 | 350 | $limit = trim($limit); |
| 351 | 351 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
| 352 | - $where = "WHERE {$where}"; |
|
| 352 | + $where = "where {$where}"; |
|
| 353 | 353 | } |
| 354 | 354 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
| 355 | - $limit = "LIMIT {$limit}"; |
|
| 355 | + $limit = "limit {$limit}"; |
|
| 356 | 356 | } |
| 357 | 357 | $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); |
| 358 | 358 | } |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
| 243 | - * @param string|array $fields |
|
| 244 | - * @param string|array $from |
|
| 245 | - * @param string|array $where |
|
| 243 | + * @param string $fields |
|
| 244 | + * @param string $from |
|
| 245 | + * @param string $where |
|
| 246 | 246 | * @param string $orderBy |
| 247 | 247 | * @param string $limit |
| 248 | 248 | * @return bool|mysqli_result |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @param string $fromtable |
| 327 | 327 | * @param string $where |
| 328 | 328 | * @param string $limit |
| 329 | - * @return mixed |
|
| 329 | + * @return null|integer |
|
| 330 | 330 | */ |
| 331 | 331 | public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $where = "", $limit = "") |
| 332 | 332 | { |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | /** |
| 370 | 370 | * @param $fields |
| 371 | - * @param $table |
|
| 371 | + * @param string $table |
|
| 372 | 372 | * @param string $where |
| 373 | 373 | * @return bool|mixed|mysqli_result |
| 374 | 374 | */ |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | |
| 436 | 436 | /** |
| 437 | 437 | * @param null|mysqli $conn |
| 438 | - * @return mixed |
|
| 438 | + * @return integer |
|
| 439 | 439 | */ |
| 440 | 440 | public function getInsertId($conn = null) |
| 441 | 441 | { |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | /** |
| 516 | - * @param $name |
|
| 516 | + * @param string $name |
|
| 517 | 517 | * @param mysqli_result|string $dsq |
| 518 | 518 | * @return array |
| 519 | 519 | */ |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | |
| 573 | 573 | /** |
| 574 | 574 | * @param string $table |
| 575 | - * @return array |
|
| 575 | + * @return boolean |
|
| 576 | 576 | */ |
| 577 | 577 | public function getTableMetaData($table) |
| 578 | 578 | { |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |
| 622 | - * @param string|mysqli_result $rs |
|
| 622 | + * @param string $rs |
|
| 623 | 623 | * @param bool $index |
| 624 | 624 | * @return array |
| 625 | 625 | */ |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $pre = null, |
| 31 | 31 | $charset = '', |
| 32 | 32 | $connection_method = 'SET CHARACTER SET' |
| 33 | - ) { |
|
| 33 | + ){ |
|
| 34 | 34 | $this->config['host'] = $host ? $host : $GLOBALS['database_server']; |
| 35 | 35 | $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; |
| 36 | 36 | $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $ua = $modx->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); |
| 71 | 71 | $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); |
| 72 | 72 | $modx->sendmail(array( |
| 73 | - 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], |
|
| 73 | + 'subject' => 'Missing to create the database connection! from '.$modx->config['site_name'], |
|
| 74 | 74 | 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", |
| 75 | 75 | 'type' => 'text' |
| 76 | 76 | )); |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | $tend = $modx->getMicroTime(); |
| 86 | 86 | $totaltime = $tend - $tstart; |
| 87 | 87 | if ($modx->dumpSQL) { |
| 88 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s", |
|
| 89 | - $totaltime) . "</fieldset><br />"; |
|
| 88 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s", |
|
| 89 | + $totaltime)."</fieldset><br />"; |
|
| 90 | 90 | } |
| 91 | 91 | $this->conn->set_charset($this->config['charset']); |
| 92 | 92 | $this->isConnected = true; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (1000 < $safeCount) { |
| 120 | 120 | exit("Too many loops '{$safeCount}'"); |
| 121 | 121 | } |
| 122 | - if ( ! ($this->conn instanceof mysqli)) { |
|
| 122 | + if (!($this->conn instanceof mysqli)) { |
|
| 123 | 123 | $this->connect(); |
| 124 | 124 | } |
| 125 | 125 | if (is_array($s)) { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | public function query($sql, $watchError = true) |
| 146 | 146 | { |
| 147 | 147 | $modx = evolutionCMS(); |
| 148 | - if ( ! ($this->conn instanceof mysqli)) { |
|
| 148 | + if (!($this->conn instanceof mysqli)) { |
|
| 149 | 149 | $this->connect(); |
| 150 | 150 | } |
| 151 | 151 | $tStart = $modx->getMicroTime(); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | case 1091: |
| 166 | 166 | break; |
| 167 | 167 | default: |
| 168 | - $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); |
|
| 168 | + $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql); |
|
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | 171 | $tend = $modx->getMicroTime(); |
@@ -179,24 +179,24 @@ discard block |
||
| 179 | 179 | $debug_path[] = $line['function']; |
| 180 | 180 | } |
| 181 | 181 | $debug_path = implode(' > ', array_reverse($debug_path)); |
| 182 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", |
|
| 183 | - $totalTime * 1000) . "</legend>"; |
|
| 184 | - $modx->queryCode .= $sql . '<br><br>'; |
|
| 182 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms", |
|
| 183 | + $totalTime * 1000)."</legend>"; |
|
| 184 | + $modx->queryCode .= $sql.'<br><br>'; |
|
| 185 | 185 | if ($modx->event->name) { |
| 186 | - $modx->queryCode .= 'Current Event => ' . $modx->event->name . '<br>'; |
|
| 186 | + $modx->queryCode .= 'Current Event => '.$modx->event->name.'<br>'; |
|
| 187 | 187 | } |
| 188 | 188 | if ($modx->event->activePlugin) { |
| 189 | - $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>'; |
|
| 189 | + $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>'; |
|
| 190 | 190 | } |
| 191 | 191 | if ($modx->currentSnippet) { |
| 192 | - $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>'; |
|
| 192 | + $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>'; |
|
| 193 | 193 | } |
| 194 | 194 | if (stripos($sql, 'select') === 0) { |
| 195 | - $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>'; |
|
| 195 | + $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>'; |
|
| 196 | 196 | } else { |
| 197 | - $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>'; |
|
| 197 | + $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>'; |
|
| 198 | 198 | } |
| 199 | - $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>'; |
|
| 199 | + $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>'; |
|
| 200 | 200 | $modx->queryCode .= "</fieldset><br />"; |
| 201 | 201 | } |
| 202 | 202 | $modx->executedQueries++; |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | if ($value === null || strtolower($value) === 'null') { |
| 304 | 304 | $f = 'NULL'; |
| 305 | 305 | } else { |
| 306 | - $f = "'" . $value . "'"; |
|
| 306 | + $f = "'".$value."'"; |
|
| 307 | 307 | } |
| 308 | - $fields[$key] = "`{$key}` = " . $f; |
|
| 308 | + $fields[$key] = "`{$key}` = ".$f; |
|
| 309 | 309 | } |
| 310 | 310 | $fields = implode(',', $fields); |
| 311 | 311 | } |
@@ -340,12 +340,12 @@ discard block |
||
| 340 | 340 | $this->query("INSERT INTO {$intotable} {$fields}"); |
| 341 | 341 | } else { |
| 342 | 342 | if (empty($fromtable)) { |
| 343 | - $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", |
|
| 344 | - array_values($fields)) . "')"; |
|
| 343 | + $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", |
|
| 344 | + array_values($fields))."')"; |
|
| 345 | 345 | $this->query("INSERT INTO {$intotable} {$fields}"); |
| 346 | 346 | } else { |
| 347 | 347 | $fromtable = $this->replaceFullTableName($fromtable); |
| 348 | - $fields = "(" . implode(",", array_keys($fields)) . ")"; |
|
| 348 | + $fields = "(".implode(",", array_keys($fields)).")"; |
|
| 349 | 349 | $where = trim($where); |
| 350 | 350 | $limit = trim($limit); |
| 351 | 351 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
@@ -439,8 +439,8 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | public function getInsertId($conn = null) |
| 441 | 441 | { |
| 442 | - if (! ($conn instanceof mysqli)) { |
|
| 443 | - $conn =& $this->conn; |
|
| 442 | + if (!($conn instanceof mysqli)) { |
|
| 443 | + $conn = & $this->conn; |
|
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | return $conn->insert_id; |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | */ |
| 453 | 453 | public function getAffectedRows($conn = null) |
| 454 | 454 | { |
| 455 | - if (! ($conn instanceof mysqli)) { |
|
| 456 | - $conn =& $this->conn; |
|
| 455 | + if (!($conn instanceof mysqli)) { |
|
| 456 | + $conn = & $this->conn; |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | return $conn->affected_rows; |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | public function getLastError($conn = null) |
| 467 | 467 | { |
| 468 | - if (! ($conn instanceof mysqli)) { |
|
| 469 | - $conn =& $this->conn; |
|
| 468 | + if (!($conn instanceof mysqli)) { |
|
| 469 | + $conn = & $this->conn; |
|
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | return $conn->error; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | { |
| 491 | 491 | $out = false; |
| 492 | 492 | if ($ds instanceof mysqli_result) { |
| 493 | - switch($mode){ |
|
| 493 | + switch ($mode) { |
|
| 494 | 494 | case 'assoc': |
| 495 | 495 | $out = $ds->fetch_assoc(); |
| 496 | 496 | break; |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | public function getColumn($name, $dsq) |
| 521 | 521 | { |
| 522 | 522 | $col = array(); |
| 523 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 523 | + if (!($dsq instanceof mysqli_result)) { |
|
| 524 | 524 | $dsq = $this->query($dsq); |
| 525 | 525 | } |
| 526 | 526 | if ($dsq) { |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | public function getColumnNames($dsq) |
| 540 | 540 | { |
| 541 | 541 | $names = array(); |
| 542 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 542 | + if (!($dsq instanceof mysqli_result)) { |
|
| 543 | 543 | $dsq = $this->query($dsq); |
| 544 | 544 | } |
| 545 | 545 | if ($dsq) { |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | public function getValue($dsq) |
| 560 | 560 | { |
| 561 | 561 | $out = false; |
| 562 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 562 | + if (!($dsq instanceof mysqli_result)) { |
|
| 563 | 563 | $dsq = $this->query($dsq); |
| 564 | 564 | } |
| 565 | 565 | if ($dsq) { |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | $tableName = trim($tableName); |
| 658 | 658 | $dbase = trim($this->config['dbase'], '`'); |
| 659 | 659 | $prefix = $this->config['table_prefix']; |
| 660 | - if ((bool)$force === true) { |
|
| 660 | + if ((bool) $force === true) { |
|
| 661 | 661 | $result = "`{$dbase}`.`{$prefix}{$tableName}`"; |
| 662 | 662 | } elseif (strpos($tableName, '[+prefix+]') !== false) { |
| 663 | 663 | $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $tableName); |
@@ -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); |