@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * NOTE: If you change these, also change the error_reporting() code below |
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | - ini_set("date.timezone", "UTC"); |
|
| 21 | + ini_set("date.timezone", "UTC"); |
|
| 22 | 22 | define('ENVIRONMENT', 'development'); |
| 23 | 23 | /* |
| 24 | 24 | *--------------------------------------------------------------- |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * as this file. |
| 69 | 69 | * |
| 70 | 70 | */ |
| 71 | - $assets_path='assets'; |
|
| 71 | + $assets_path='assets'; |
|
| 72 | 72 | /* |
| 73 | 73 | *--------------------------------------------------------------- |
| 74 | 74 | * APPLICATION FOLDER NAME |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * as this file. |
| 69 | 69 | * |
| 70 | 70 | */ |
| 71 | - $assets_path='assets'; |
|
| 71 | + $assets_path = 'assets'; |
|
| 72 | 72 | /* |
| 73 | 73 | *--------------------------------------------------------------- |
| 74 | 74 | * APPLICATION FOLDER NAME |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); |
| 188 | 188 | |
| 189 | 189 | //Name of the "assets folder' |
| 190 | - define('ASSETSDIR',realpath($assets_path).'/'); |
|
| 190 | + define('ASSETSDIR', realpath($assets_path).'/'); |
|
| 191 | 191 | |
| 192 | 192 | // The path to the "application" folder |
| 193 | 193 | if (is_dir($application_folder)) |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | * @var string |
| 33 | 33 | * @access protected |
| 34 | 34 | */ |
| 35 | - protected $_xss_hash = ''; |
|
| 35 | + protected $_xss_hash = ''; |
|
| 36 | 36 | /** |
| 37 | 37 | * Random Hash for Cross Site Request Forgery Protection Cookie |
| 38 | 38 | * |
| 39 | 39 | * @var string |
| 40 | 40 | * @access protected |
| 41 | 41 | */ |
| 42 | - protected $_csrf_hash = ''; |
|
| 42 | + protected $_csrf_hash = ''; |
|
| 43 | 43 | /** |
| 44 | 44 | * Expiration time for Cross Site Request Forgery Protection Cookie |
| 45 | 45 | * Defaults to two hours (in seconds) |
@@ -47,21 +47,21 @@ discard block |
||
| 47 | 47 | * @var int |
| 48 | 48 | * @access protected |
| 49 | 49 | */ |
| 50 | - protected $_csrf_expire = 7200; |
|
| 50 | + protected $_csrf_expire = 7200; |
|
| 51 | 51 | /** |
| 52 | 52 | * Token name for Cross Site Request Forgery Protection Cookie |
| 53 | 53 | * |
| 54 | 54 | * @var string |
| 55 | 55 | * @access protected |
| 56 | 56 | */ |
| 57 | - protected $_csrf_token_name = 'ci_csrf_token'; |
|
| 57 | + protected $_csrf_token_name = 'ci_csrf_token'; |
|
| 58 | 58 | /** |
| 59 | 59 | * Cookie name for Cross Site Request Forgery Protection Cookie |
| 60 | 60 | * |
| 61 | 61 | * @var string |
| 62 | 62 | * @access protected |
| 63 | 63 | */ |
| 64 | - protected $_csrf_cookie_name = 'ci_csrf_token'; |
|
| 64 | + protected $_csrf_cookie_name = 'ci_csrf_token'; |
|
| 65 | 65 | /** |
| 66 | 66 | * List of never allowed strings |
| 67 | 67 | * |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public function __construct() |
| 102 | 102 | { |
| 103 | 103 | // CSRF config |
| 104 | - foreach(array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key) |
|
| 104 | + foreach (array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key) |
|
| 105 | 105 | { |
| 106 | 106 | if (FALSE !== ($val = config_item($key))) |
| 107 | 107 | { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | else |
| 356 | 356 | { |
| 357 | - $str = str_replace(array('<?', '?'.'>'), array('<?', '?>'), $str); |
|
| 357 | + $str = str_replace(array('<?', '?'.'>'), array('<?', '?>'), $str); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /* |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); |
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | - while($original != $str); |
|
| 410 | + while ($original != $str); |
|
| 411 | 411 | |
| 412 | 412 | unset($original); |
| 413 | 413 | |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | if ($is_image === TRUE) |
| 460 | 460 | { |
| 461 | - return ($str == $converted_string) ? TRUE: FALSE; |
|
| 461 | + return ($str == $converted_string) ? TRUE : FALSE; |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | log_message('debug', "XSS Filtering completed"); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | * @param string |
| 501 | 501 | * @return string |
| 502 | 502 | */ |
| 503 | - public function entity_decode($str, $charset='UTF-8') |
|
| 503 | + public function entity_decode($str, $charset = 'UTF-8') |
|
| 504 | 504 | { |
| 505 | 505 | if (stristr($str, '&') === FALSE) |
| 506 | 506 | { |
@@ -543,17 +543,17 @@ discard block |
||
| 543 | 543 | '?', |
| 544 | 544 | "%20", |
| 545 | 545 | "%22", |
| 546 | - "%3c", // < |
|
| 547 | - "%253c", // < |
|
| 548 | - "%3e", // > |
|
| 549 | - "%0e", // > |
|
| 550 | - "%28", // ( |
|
| 551 | - "%29", // ) |
|
| 552 | - "%2528", // ( |
|
| 553 | - "%26", // & |
|
| 554 | - "%24", // $ |
|
| 555 | - "%3f", // ? |
|
| 556 | - "%3b", // ; |
|
| 546 | + "%3c", // < |
|
| 547 | + "%253c", // < |
|
| 548 | + "%3e", // > |
|
| 549 | + "%0e", // > |
|
| 550 | + "%28", // ( |
|
| 551 | + "%29", // ) |
|
| 552 | + "%2528", // ( |
|
| 553 | + "%26", // & |
|
| 554 | + "%24", // $ |
|
| 555 | + "%3f", // ? |
|
| 556 | + "%3b", // ; |
|
| 557 | 557 | "%3d" // = |
| 558 | 558 | ); |
| 559 | 559 | |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | $attribs = array(); |
| 620 | 620 | |
| 621 | 621 | // find occurrences of illegal attribute strings without quotes |
| 622 | - preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is", $str, $matches, PREG_SET_ORDER); |
|
| 622 | + preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is", $str, $matches, PREG_SET_ORDER); |
|
| 623 | 623 | |
| 624 | 624 | foreach ($matches as $attr) |
| 625 | 625 | { |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) |
| 630 | - preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); |
|
| 630 | + preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); |
|
| 631 | 631 | |
| 632 | 632 | foreach ($matches as $attr) |
| 633 | 633 | { |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | * Just as above, adds a semicolon if missing. |
| 798 | 798 | * |
| 799 | 799 | */ |
| 800 | - $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); |
|
| 800 | + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i', "\\1\\2;", $str); |
|
| 801 | 801 | |
| 802 | 802 | /* |
| 803 | 803 | * Un-Protect GET variables in URLs |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | // Get mime types for later |
| 97 | 97 | if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) |
| 98 | 98 | { |
| 99 | - include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; |
|
| 99 | + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; |
|
| 100 | 100 | } |
| 101 | 101 | else |
| 102 | 102 | { |
@@ -41,35 +41,35 @@ discard block |
||
| 41 | 41 | * @var int |
| 42 | 42 | * @access protected |
| 43 | 43 | */ |
| 44 | - protected $cache_expiration = 0; |
|
| 44 | + protected $cache_expiration = 0; |
|
| 45 | 45 | /** |
| 46 | 46 | * List of server headers |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | * @access protected |
| 50 | 50 | */ |
| 51 | - protected $headers = array(); |
|
| 51 | + protected $headers = array(); |
|
| 52 | 52 | /** |
| 53 | 53 | * List of mime types |
| 54 | 54 | * |
| 55 | 55 | * @var array |
| 56 | 56 | * @access protected |
| 57 | 57 | */ |
| 58 | - protected $mime_types = array(); |
|
| 58 | + protected $mime_types = array(); |
|
| 59 | 59 | /** |
| 60 | 60 | * Determines wether profiler is enabled |
| 61 | 61 | * |
| 62 | 62 | * @var book |
| 63 | 63 | * @access protected |
| 64 | 64 | */ |
| 65 | - protected $enable_profiler = FALSE; |
|
| 65 | + protected $enable_profiler = FALSE; |
|
| 66 | 66 | /** |
| 67 | 67 | * Determines if output compression is enabled |
| 68 | 68 | * |
| 69 | 69 | * @var bool |
| 70 | 70 | * @access protected |
| 71 | 71 | */ |
| 72 | - protected $_zlib_oc = FALSE; |
|
| 72 | + protected $_zlib_oc = FALSE; |
|
| 73 | 73 | /** |
| 74 | 74 | * List of profiler sections |
| 75 | 75 | * |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @var bool |
| 84 | 84 | * @access protected |
| 85 | 85 | */ |
| 86 | - protected $parse_exec_vars = TRUE; |
|
| 86 | + protected $parse_exec_vars = TRUE; |
|
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Constructor |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | // Is this extension supported? |
| 218 | 218 | if (isset($this->mime_types[$extension])) |
| 219 | 219 | { |
| 220 | - $mime_type =& $this->mime_types[$extension]; |
|
| 220 | + $mime_type = & $this->mime_types[$extension]; |
|
| 221 | 221 | |
| 222 | 222 | if (is_array($mime_type)) |
| 223 | 223 | { |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | // Grab the super object if we can. |
| 332 | 332 | if (class_exists('CI_Controller')) |
| 333 | 333 | { |
| 334 | - $CI =& get_instance(); |
|
| 334 | + $CI = & get_instance(); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | // -------------------------------------------------------------------- |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | // Set the output data |
| 340 | 340 | if ($output == '') |
| 341 | 341 | { |
| 342 | - $output =& $this->final_output; |
|
| 342 | + $output = & $this->final_output; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | // -------------------------------------------------------------------- |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | if ($this->parse_exec_vars === TRUE) |
| 363 | 363 | { |
| 364 | - $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; |
|
| 364 | + $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage() / 1024 / 1024, 2).'MB'; |
|
| 365 | 365 | |
| 366 | 366 | $output = str_replace('{elapsed_time}', $elapsed, $output); |
| 367 | 367 | $output = str_replace('{memory_usage}', $memory, $output); |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | } |
| 443 | 443 | else |
| 444 | 444 | { |
| 445 | - echo $output; // Send it to the browser! |
|
| 445 | + echo $output; // Send it to the browser! |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | log_message('debug', "Final output sent to browser"); |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | function _write_cache($output) |
| 462 | 462 | { |
| 463 | - $CI =& get_instance(); |
|
| 463 | + $CI = & get_instance(); |
|
| 464 | 464 | $path = $CI->config->item('cache_path'); |
| 465 | 465 | |
| 466 | 466 | $cache_path = ($path == '') ? APPPATH.'cache/' : $path; |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | return; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - $uri = $CI->config->item('base_url'). |
|
| 474 | + $uri = $CI->config->item('base_url'). |
|
| 475 | 475 | $CI->config->item('index_page'). |
| 476 | 476 | $CI->uri->uri_string(); |
| 477 | 477 | |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path'); |
| 517 | 517 | |
| 518 | 518 | // Build the file path. The file name is an MD5 hash of the full URI |
| 519 | - $uri = $CFG->item('base_url'). |
|
| 519 | + $uri = $CFG->item('base_url'). |
|
| 520 | 520 | $CFG->item('index_page'). |
| 521 | 521 | $URI->uri_string; |
| 522 | 522 | |
@@ -316,7 +316,7 @@ |
||
| 316 | 316 | $uri = $str; |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | - return $uri; |
|
| 319 | + return $uri; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | // -------------------------------------------------------------------- |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function __construct() |
| 62 | 62 | { |
| 63 | - $this->config =& get_config(); |
|
| 63 | + $this->config = & get_config(); |
|
| 64 | 64 | log_message('debug', "Config Class Initialized"); |
| 65 | 65 | |
| 66 | 66 | // Set the base_url automatically if none was provided |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | if (isset($_SERVER['HTTP_HOST'])) |
| 70 | 70 | { |
| 71 | 71 | $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; |
| 72 | - $base_url .= '://'. $_SERVER['HTTP_HOST']; |
|
| 72 | + $base_url .= '://'.$_SERVER['HTTP_HOST']; |
|
| 73 | 73 | $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | { |
| 232 | 232 | return FALSE; |
| 233 | 233 | } |
| 234 | - if( trim($this->config[$item]) == '') |
|
| 234 | + if (trim($this->config[$item]) == '') |
|
| 235 | 235 | { |
| 236 | 236 | return ''; |
| 237 | 237 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | function base_url($uri = '') |
| 281 | 281 | { |
| 282 | - return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/'); |
|
| 282 | + return $this->slash_item('base_url').ltrim($this->_uri_string($uri), '/'); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | // ------------------------------------------------------------- |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * Start the timer... tick tock tick tock... |
| 113 | 113 | * ------------------------------------------------------ |
| 114 | 114 | */ |
| 115 | - $BM =& load_class('Benchmark', 'core'); |
|
| 115 | + $BM = & load_class('Benchmark', 'core'); |
|
| 116 | 116 | $BM->mark('total_execution_time_start'); |
| 117 | 117 | $BM->mark('loading_time:_base_classes_start'); |
| 118 | 118 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * Instantiate the hooks class |
| 122 | 122 | * ------------------------------------------------------ |
| 123 | 123 | */ |
| 124 | - $EXT =& load_class('Hooks', 'core'); |
|
| 124 | + $EXT = & load_class('Hooks', 'core'); |
|
| 125 | 125 | |
| 126 | 126 | /* |
| 127 | 127 | * ------------------------------------------------------ |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * Instantiate the config class |
| 136 | 136 | * ------------------------------------------------------ |
| 137 | 137 | */ |
| 138 | - $CFG =& load_class('Config', 'core'); |
|
| 138 | + $CFG = & load_class('Config', 'core'); |
|
| 139 | 139 | |
| 140 | 140 | // Do we have any manually set config items in the index.php file? |
| 141 | 141 | if (isset($assign_to_config)) |
@@ -155,21 +155,21 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | */ |
| 157 | 157 | |
| 158 | - $UNI =& load_class('Utf8', 'core'); |
|
| 158 | + $UNI = & load_class('Utf8', 'core'); |
|
| 159 | 159 | |
| 160 | 160 | /* |
| 161 | 161 | * ------------------------------------------------------ |
| 162 | 162 | * Instantiate the URI class |
| 163 | 163 | * ------------------------------------------------------ |
| 164 | 164 | */ |
| 165 | - $URI =& load_class('URI', 'core'); |
|
| 165 | + $URI = & load_class('URI', 'core'); |
|
| 166 | 166 | |
| 167 | 167 | /* |
| 168 | 168 | * ------------------------------------------------------ |
| 169 | 169 | * Instantiate the routing class and set the routing |
| 170 | 170 | * ------------------------------------------------------ |
| 171 | 171 | */ |
| 172 | - $RTR =& load_class('Router', 'core'); |
|
| 172 | + $RTR = & load_class('Router', 'core'); |
|
| 173 | 173 | $RTR->_set_routing(); |
| 174 | 174 | |
| 175 | 175 | // Set any routing overrides that may exist in the main index file |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * Instantiate the output class |
| 184 | 184 | * ------------------------------------------------------ |
| 185 | 185 | */ |
| 186 | - $OUT =& load_class('Output', 'core'); |
|
| 186 | + $OUT = & load_class('Output', 'core'); |
|
| 187 | 187 | |
| 188 | 188 | /* |
| 189 | 189 | * ------------------------------------------------------ |
@@ -203,21 +203,21 @@ discard block |
||
| 203 | 203 | * Load the security class for xss and csrf support |
| 204 | 204 | * ----------------------------------------------------- |
| 205 | 205 | */ |
| 206 | - $SEC =& load_class('Security', 'core'); |
|
| 206 | + $SEC = & load_class('Security', 'core'); |
|
| 207 | 207 | |
| 208 | 208 | /* |
| 209 | 209 | * ------------------------------------------------------ |
| 210 | 210 | * Load the Input class and sanitize globals |
| 211 | 211 | * ------------------------------------------------------ |
| 212 | 212 | */ |
| 213 | - $IN =& load_class('Input', 'core'); |
|
| 213 | + $IN = & load_class('Input', 'core'); |
|
| 214 | 214 | |
| 215 | 215 | /* |
| 216 | 216 | * ------------------------------------------------------ |
| 217 | 217 | * Load the Language class |
| 218 | 218 | * ------------------------------------------------------ |
| 219 | 219 | */ |
| 220 | - $LANG =& load_class('Lang', 'core'); |
|
| 220 | + $LANG = & load_class('Lang', 'core'); |
|
| 221 | 221 | |
| 222 | 222 | /* |
| 223 | 223 | * ------------------------------------------------------ |
@@ -254,7 +254,7 @@ |
||
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | $_config[0] =& $config; |
| 257 | - return $_config[0]; |
|
| 257 | + return $_config[0]; |
|
| 258 | 258 | |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // write a file then read it. Bah... |
| 82 | 82 | if (is_dir($file)) |
| 83 | 83 | { |
| 84 | - $file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100)); |
|
| 84 | + $file = rtrim($file, '/').'/'.md5(mt_rand(1, 100).mt_rand(1, 100)); |
|
| 85 | 85 | |
| 86 | 86 | if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) |
| 87 | 87 | { |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | - $_config[0] =& $config; |
|
| 256 | + $_config[0] = & $config; |
|
| 257 | 257 | return $_config[0]; |
| 258 | 258 | |
| 259 | 259 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | if ( ! isset($_config_item[$item])) |
| 277 | 277 | { |
| 278 | - $config =& get_config(); |
|
| 278 | + $config = & get_config(); |
|
| 279 | 279 | |
| 280 | 280 | if ( ! isset($config[$item])) |
| 281 | 281 | { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | { |
| 307 | 307 | function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered') |
| 308 | 308 | { |
| 309 | - $_error =& load_class('Exceptions', 'core'); |
|
| 309 | + $_error = & load_class('Exceptions', 'core'); |
|
| 310 | 310 | echo $_error->show_error($heading, $message, 'error_general', $status_code); |
| 311 | 311 | exit; |
| 312 | 312 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | { |
| 329 | 329 | function show_404($page = '', $log_error = TRUE) |
| 330 | 330 | { |
| 331 | - $_error =& load_class('Exceptions', 'core'); |
|
| 331 | + $_error = & load_class('Exceptions', 'core'); |
|
| 332 | 332 | $_error->show_404($page, $log_error); |
| 333 | 333 | exit; |
| 334 | 334 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | return; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | - $_log =& load_class('Log'); |
|
| 359 | + $_log = & load_class('Log'); |
|
| 360 | 360 | $_log->write_log($level, $message, $php_error); |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | return; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | - $_error =& load_class('Exceptions', 'core'); |
|
| 482 | + $_error = & load_class('Exceptions', 'core'); |
|
| 483 | 483 | |
| 484 | 484 | // Should we display the error? We'll get the current error_reporting |
| 485 | 485 | // level and add its bits with the severity bits to find out. |
@@ -521,11 +521,11 @@ discard block |
||
| 521 | 521 | |
| 522 | 522 | if ($url_encoded) |
| 523 | 523 | { |
| 524 | - $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15 |
|
| 525 | - $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31 |
|
| 524 | + $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15 |
|
| 525 | + $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31 |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | - $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 |
|
| 528 | + $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 |
|
| 529 | 529 | |
| 530 | 530 | do |
| 531 | 531 | { |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | // -------------------------------------------------------------------- |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * Fetch an item from the GET array |
|
| 138 | - * |
|
| 139 | - * @access public |
|
| 140 | - * @param string |
|
| 141 | - * @param bool |
|
| 142 | - * @return string |
|
| 143 | - */ |
|
| 137 | + * Fetch an item from the GET array |
|
| 138 | + * |
|
| 139 | + * @access public |
|
| 140 | + * @param string |
|
| 141 | + * @param bool |
|
| 142 | + * @return string |
|
| 143 | + */ |
|
| 144 | 144 | function get($index = NULL, $xss_clean = FALSE) |
| 145 | 145 | { |
| 146 | 146 | // Check if a field has been provided |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | // -------------------------------------------------------------------- |
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | - * Fetch an item from the POST array |
|
| 166 | - * |
|
| 167 | - * @access public |
|
| 168 | - * @param string |
|
| 169 | - * @param bool |
|
| 170 | - * @return string |
|
| 171 | - */ |
|
| 165 | + * Fetch an item from the POST array |
|
| 166 | + * |
|
| 167 | + * @access public |
|
| 168 | + * @param string |
|
| 169 | + * @param bool |
|
| 170 | + * @return string |
|
| 171 | + */ |
|
| 172 | 172 | function post($index = NULL, $xss_clean = FALSE) |
| 173 | 173 | { |
| 174 | 174 | // Check if a field has been provided |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | // -------------------------------------------------------------------- |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * Fetch an item from either the GET array or the POST |
|
| 195 | - * |
|
| 196 | - * @access public |
|
| 197 | - * @param string The index key |
|
| 198 | - * @param bool XSS cleaning |
|
| 199 | - * @return string |
|
| 200 | - */ |
|
| 194 | + * Fetch an item from either the GET array or the POST |
|
| 195 | + * |
|
| 196 | + * @access public |
|
| 197 | + * @param string The index key |
|
| 198 | + * @param bool XSS cleaning |
|
| 199 | + * @return string |
|
| 200 | + */ |
|
| 201 | 201 | function get_post($index = '', $xss_clean = FALSE) |
| 202 | 202 | { |
| 203 | 203 | if ( ! isset($_POST[$index]) ) |
@@ -213,13 +213,13 @@ discard block |
||
| 213 | 213 | // -------------------------------------------------------------------- |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Fetch an item from the COOKIE array |
|
| 217 | - * |
|
| 218 | - * @access public |
|
| 219 | - * @param string |
|
| 220 | - * @param bool |
|
| 221 | - * @return string |
|
| 222 | - */ |
|
| 216 | + * Fetch an item from the COOKIE array |
|
| 217 | + * |
|
| 218 | + * @access public |
|
| 219 | + * @param string |
|
| 220 | + * @param bool |
|
| 221 | + * @return string |
|
| 222 | + */ |
|
| 223 | 223 | function cookie($index = '', $xss_clean = FALSE) |
| 224 | 224 | { |
| 225 | 225 | return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); |
@@ -228,21 +228,21 @@ discard block |
||
| 228 | 228 | // ------------------------------------------------------------------------ |
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | - * Set cookie |
|
| 232 | - * |
|
| 233 | - * Accepts six parameter, or you can submit an associative |
|
| 234 | - * array in the first parameter containing all the values. |
|
| 235 | - * |
|
| 236 | - * @access public |
|
| 237 | - * @param mixed |
|
| 238 | - * @param string the value of the cookie |
|
| 239 | - * @param string the number of seconds until expiration |
|
| 240 | - * @param string the cookie domain. Usually: .yourdomain.com |
|
| 241 | - * @param string the cookie path |
|
| 242 | - * @param string the cookie prefix |
|
| 243 | - * @param bool true makes the cookie secure |
|
| 244 | - * @return void |
|
| 245 | - */ |
|
| 231 | + * Set cookie |
|
| 232 | + * |
|
| 233 | + * Accepts six parameter, or you can submit an associative |
|
| 234 | + * array in the first parameter containing all the values. |
|
| 235 | + * |
|
| 236 | + * @access public |
|
| 237 | + * @param mixed |
|
| 238 | + * @param string the value of the cookie |
|
| 239 | + * @param string the number of seconds until expiration |
|
| 240 | + * @param string the cookie domain. Usually: .yourdomain.com |
|
| 241 | + * @param string the cookie path |
|
| 242 | + * @param string the cookie prefix |
|
| 243 | + * @param bool true makes the cookie secure |
|
| 244 | + * @return void |
|
| 245 | + */ |
|
| 246 | 246 | function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) |
| 247 | 247 | { |
| 248 | 248 | if (is_array($name)) |
@@ -289,13 +289,13 @@ discard block |
||
| 289 | 289 | // -------------------------------------------------------------------- |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Fetch an item from the SERVER array |
|
| 293 | - * |
|
| 294 | - * @access public |
|
| 295 | - * @param string |
|
| 296 | - * @param bool |
|
| 297 | - * @return string |
|
| 298 | - */ |
|
| 292 | + * Fetch an item from the SERVER array |
|
| 293 | + * |
|
| 294 | + * @access public |
|
| 295 | + * @param string |
|
| 296 | + * @param bool |
|
| 297 | + * @return string |
|
| 298 | + */ |
|
| 299 | 299 | function server($index = '', $xss_clean = FALSE) |
| 300 | 300 | { |
| 301 | 301 | return $this->_fetch_from_array($_SERVER, $index, $xss_clean); |
@@ -304,11 +304,11 @@ discard block |
||
| 304 | 304 | // -------------------------------------------------------------------- |
| 305 | 305 | |
| 306 | 306 | /** |
| 307 | - * Fetch the IP Address |
|
| 308 | - * |
|
| 309 | - * @access public |
|
| 310 | - * @return string |
|
| 311 | - */ |
|
| 307 | + * Fetch the IP Address |
|
| 308 | + * |
|
| 309 | + * @access public |
|
| 310 | + * @return string |
|
| 311 | + */ |
|
| 312 | 312 | function ip_address() |
| 313 | 313 | { |
| 314 | 314 | if ($this->ip_address !== FALSE) |
@@ -363,14 +363,14 @@ discard block |
||
| 363 | 363 | // -------------------------------------------------------------------- |
| 364 | 364 | |
| 365 | 365 | /** |
| 366 | - * Validate IP Address |
|
| 367 | - * |
|
| 368 | - * Updated version suggested by Geert De Deckere |
|
| 369 | - * |
|
| 370 | - * @access public |
|
| 371 | - * @param string |
|
| 372 | - * @return string |
|
| 373 | - */ |
|
| 366 | + * Validate IP Address |
|
| 367 | + * |
|
| 368 | + * Updated version suggested by Geert De Deckere |
|
| 369 | + * |
|
| 370 | + * @access public |
|
| 371 | + * @param string |
|
| 372 | + * @return string |
|
| 373 | + */ |
|
| 374 | 374 | function valid_ip($ip) |
| 375 | 375 | { |
| 376 | 376 | $ip_segments = explode('.', $ip); |
@@ -402,11 +402,11 @@ discard block |
||
| 402 | 402 | // -------------------------------------------------------------------- |
| 403 | 403 | |
| 404 | 404 | /** |
| 405 | - * User Agent |
|
| 406 | - * |
|
| 407 | - * @access public |
|
| 408 | - * @return string |
|
| 409 | - */ |
|
| 405 | + * User Agent |
|
| 406 | + * |
|
| 407 | + * @access public |
|
| 408 | + * @return string |
|
| 409 | + */ |
|
| 410 | 410 | function user_agent() |
| 411 | 411 | { |
| 412 | 412 | if ($this->user_agent !== FALSE) |
@@ -422,19 +422,19 @@ discard block |
||
| 422 | 422 | // -------------------------------------------------------------------- |
| 423 | 423 | |
| 424 | 424 | /** |
| 425 | - * Sanitize Globals |
|
| 426 | - * |
|
| 427 | - * This function does the following: |
|
| 428 | - * |
|
| 429 | - * Unsets $_GET data (if query strings are not enabled) |
|
| 430 | - * |
|
| 431 | - * Unsets all globals if register_globals is enabled |
|
| 432 | - * |
|
| 433 | - * Standardizes newline characters to \n |
|
| 434 | - * |
|
| 435 | - * @access private |
|
| 436 | - * @return void |
|
| 437 | - */ |
|
| 425 | + * Sanitize Globals |
|
| 426 | + * |
|
| 427 | + * This function does the following: |
|
| 428 | + * |
|
| 429 | + * Unsets $_GET data (if query strings are not enabled) |
|
| 430 | + * |
|
| 431 | + * Unsets all globals if register_globals is enabled |
|
| 432 | + * |
|
| 433 | + * Standardizes newline characters to \n |
|
| 434 | + * |
|
| 435 | + * @access private |
|
| 436 | + * @return void |
|
| 437 | + */ |
|
| 438 | 438 | function _sanitize_globals() |
| 439 | 439 | { |
| 440 | 440 | // It would be "wrong" to unset any of these GLOBALS. |
@@ -527,15 +527,15 @@ discard block |
||
| 527 | 527 | // -------------------------------------------------------------------- |
| 528 | 528 | |
| 529 | 529 | /** |
| 530 | - * Clean Input Data |
|
| 531 | - * |
|
| 532 | - * This is a helper function. It escapes data and |
|
| 533 | - * standardizes newline characters to \n |
|
| 534 | - * |
|
| 535 | - * @access private |
|
| 536 | - * @param string |
|
| 537 | - * @return string |
|
| 538 | - */ |
|
| 530 | + * Clean Input Data |
|
| 531 | + * |
|
| 532 | + * This is a helper function. It escapes data and |
|
| 533 | + * standardizes newline characters to \n |
|
| 534 | + * |
|
| 535 | + * @access private |
|
| 536 | + * @param string |
|
| 537 | + * @return string |
|
| 538 | + */ |
|
| 539 | 539 | function _clean_input_data($str) |
| 540 | 540 | { |
| 541 | 541 | if (is_array($str)) |
@@ -588,16 +588,16 @@ discard block |
||
| 588 | 588 | // -------------------------------------------------------------------- |
| 589 | 589 | |
| 590 | 590 | /** |
| 591 | - * Clean Keys |
|
| 592 | - * |
|
| 593 | - * This is a helper function. To prevent malicious users |
|
| 594 | - * from trying to exploit keys we make sure that keys are |
|
| 595 | - * only named with alpha-numeric text and a few other items. |
|
| 596 | - * |
|
| 597 | - * @access private |
|
| 598 | - * @param string |
|
| 599 | - * @return string |
|
| 600 | - */ |
|
| 591 | + * Clean Keys |
|
| 592 | + * |
|
| 593 | + * This is a helper function. To prevent malicious users |
|
| 594 | + * from trying to exploit keys we make sure that keys are |
|
| 595 | + * only named with alpha-numeric text and a few other items. |
|
| 596 | + * |
|
| 597 | + * @access private |
|
| 598 | + * @param string |
|
| 599 | + * @return string |
|
| 600 | + */ |
|
| 601 | 601 | function _clean_input_keys($str) |
| 602 | 602 | { |
| 603 | 603 | if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) |
@@ -33,45 +33,45 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var string |
| 35 | 35 | */ |
| 36 | - var $ip_address = FALSE; |
|
| 36 | + var $ip_address = FALSE; |
|
| 37 | 37 | /** |
| 38 | 38 | * user agent (web browser) being used by the current user |
| 39 | 39 | * |
| 40 | 40 | * @var string |
| 41 | 41 | */ |
| 42 | - var $user_agent = FALSE; |
|
| 42 | + var $user_agent = FALSE; |
|
| 43 | 43 | /** |
| 44 | 44 | * If FALSE, then $_GET will be set to an empty array |
| 45 | 45 | * |
| 46 | 46 | * @var bool |
| 47 | 47 | */ |
| 48 | - var $_allow_get_array = TRUE; |
|
| 48 | + var $_allow_get_array = TRUE; |
|
| 49 | 49 | /** |
| 50 | 50 | * If TRUE, then newlines are standardized |
| 51 | 51 | * |
| 52 | 52 | * @var bool |
| 53 | 53 | */ |
| 54 | - var $_standardize_newlines = TRUE; |
|
| 54 | + var $_standardize_newlines = TRUE; |
|
| 55 | 55 | /** |
| 56 | 56 | * Determines whether the XSS filter is always active when GET, POST or COOKIE data is encountered |
| 57 | 57 | * Set automatically based on config setting |
| 58 | 58 | * |
| 59 | 59 | * @var bool |
| 60 | 60 | */ |
| 61 | - var $_enable_xss = FALSE; |
|
| 61 | + var $_enable_xss = FALSE; |
|
| 62 | 62 | /** |
| 63 | 63 | * Enables a CSRF cookie token to be set. |
| 64 | 64 | * Set automatically based on config setting |
| 65 | 65 | * |
| 66 | 66 | * @var bool |
| 67 | 67 | */ |
| 68 | - var $_enable_csrf = FALSE; |
|
| 68 | + var $_enable_csrf = FALSE; |
|
| 69 | 69 | /** |
| 70 | 70 | * List of all HTTP request headers |
| 71 | 71 | * |
| 72 | 72 | * @var array |
| 73 | 73 | */ |
| 74 | - protected $headers = array(); |
|
| 74 | + protected $headers = array(); |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -85,18 +85,18 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | log_message('debug', "Input Class Initialized"); |
| 87 | 87 | |
| 88 | - $this->_allow_get_array = (config_item('allow_get_array') === TRUE); |
|
| 89 | - $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
| 90 | - $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
| 88 | + $this->_allow_get_array = (config_item('allow_get_array') === TRUE); |
|
| 89 | + $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
| 90 | + $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
| 91 | 91 | |
| 92 | 92 | global $SEC; |
| 93 | - $this->security =& $SEC; |
|
| 93 | + $this->security = & $SEC; |
|
| 94 | 94 | |
| 95 | 95 | // Do we need the UTF-8 class? |
| 96 | 96 | if (UTF8_ENABLED === TRUE) |
| 97 | 97 | { |
| 98 | 98 | global $UNI; |
| 99 | - $this->uni =& $UNI; |
|
| 99 | + $this->uni = & $UNI; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // Sanitize global arrays |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | function get_post($index = '', $xss_clean = FALSE) |
| 202 | 202 | { |
| 203 | - if ( ! isset($_POST[$index]) ) |
|
| 203 | + if ( ! isset($_POST[$index])) |
|
| 204 | 204 | { |
| 205 | 205 | return $this->get($index, $xss_clean); |
| 206 | 206 | } |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - var $language = array(); |
|
| 34 | + var $language = array(); |
|
| 35 | 35 | /** |
| 36 | 36 | * List of loaded language files |
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - var $is_loaded = array(); |
|
| 40 | + var $is_loaded = array(); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Constructor |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $config =& get_config(); |
|
| 81 | + $config = & get_config(); |
|
| 82 | 82 | |
| 83 | 83 | if ($idiom == '') |
| 84 | 84 | { |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | |
| 83 | 83 | if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) |
| 84 | 84 | { |
| 85 | - include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); |
|
| 85 | + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); |
|
| 86 | 86 | } |
| 87 | 87 | elseif (is_file(APPPATH.'config/hooks.php')) |
| 88 | 88 | { |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var bool |
| 35 | 35 | */ |
| 36 | - var $enabled = FALSE; |
|
| 36 | + var $enabled = FALSE; |
|
| 37 | 37 | /** |
| 38 | 38 | * List of all hooks set in config/hooks.php |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - var $hooks = array(); |
|
| 42 | + var $hooks = array(); |
|
| 43 | 43 | /** |
| 44 | 44 | * Determines wether hook is in progress, used to prevent infinte loops |
| 45 | 45 | * |
| 46 | 46 | * @var bool |
| 47 | 47 | */ |
| 48 | - var $in_progress = FALSE; |
|
| 48 | + var $in_progress = FALSE; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Constructor |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | function _initialize() |
| 69 | 69 | { |
| 70 | - $CFG =& load_class('Config', 'core'); |
|
| 70 | + $CFG = & load_class('Config', 'core'); |
|
| 71 | 71 | |
| 72 | 72 | // If hooks are not enabled in the config file |
| 73 | 73 | // there is nothing else to do |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $this->hooks =& $hook; |
|
| 98 | + $this->hooks = & $hook; |
|
| 99 | 99 | $this->enabled = TRUE; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | // Set class/function name |
| 183 | 183 | // ----------------------------------- |
| 184 | 184 | |
| 185 | - $class = FALSE; |
|
| 186 | - $function = FALSE; |
|
| 187 | - $params = ''; |
|
| 185 | + $class = FALSE; |
|
| 186 | + $function = FALSE; |
|
| 187 | + $params = ''; |
|
| 188 | 188 | |
| 189 | 189 | if (isset($data['class']) AND $data['class'] != '') |
| 190 | 190 | { |