diff options
author | Andrey Andreev <narf@devilix.net> | 2014-02-20 17:05:58 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-02-20 17:05:58 +0100 |
commit | f62747451d1f040b36db7611255d7c1b3cdffcdf (patch) | |
tree | bdbf06d942fb0a19454d987de0d89f142709013c | |
parent | bb3edf12d0ca82c62f7b7d570108375ec4379749 (diff) |
Don't use error suppression on ini_get() either
-rw-r--r-- | system/core/Common.php | 8 | ||||
-rw-r--r-- | system/core/Loader.php | 4 | ||||
-rw-r--r-- | system/core/Output.php | 2 | ||||
-rw-r--r-- | system/libraries/Cache/drivers/Cache_apc.php | 2 | ||||
-rw-r--r-- | system/libraries/Email.php | 2 | ||||
-rw-r--r-- | system/libraries/Upload.php | 2 |
6 files changed, 9 insertions, 11 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 7591cd794..0ea53c4e2 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -83,7 +83,7 @@ if ( ! function_exists('is_really_writable')) function is_really_writable($file) { // If we're on a Unix server with safe_mode off we call is_writable - if (DIRECTORY_SEPARATOR === '/' && (is_php('5.4') OR (bool) @ini_get('safe_mode') === FALSE)) + if (DIRECTORY_SEPARATOR === '/' && (is_php('5.4') OR ! ini_get('safe_mode'))) { return is_writable($file); } @@ -600,7 +600,7 @@ if ( ! function_exists('_exception_handler')) $_error->log_exception($severity, $message, $filepath, $line); // Should we display the error? - if ((bool) ini_get('display_errors') === TRUE) + if (ini_get('display_errors')) { $_error->show_php_error($severity, $message, $filepath, $line); } @@ -775,9 +775,9 @@ if ( ! function_exists('function_usable')) { if (extension_loaded('suhosin')) { - $_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist'))); + $_suhosin_func_blacklist = explode(',', trim(ini_get('suhosin.executor.func.blacklist'))); - if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval')) + if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && ini_get('suhosin.executor.disable_eval')) { $_suhosin_func_blacklist[] = 'eval'; } diff --git a/system/core/Loader.php b/system/core/Loader.php index 2d40ab5b8..be2b05cbe 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -901,9 +901,7 @@ class CI_Loader { // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. - if ( ! is_php('5.4') && (bool) @ini_get('short_open_tag') === FALSE - && config_item('rewrite_short_tags') === TRUE && function_usable('eval') - ) + if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE && function_usable('eval')) { echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); } diff --git a/system/core/Output.php b/system/core/Output.php index ef56a97bf..e8c1c3972 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -120,7 +120,7 @@ class CI_Output { */ public function __construct() { - $this->_zlib_oc = (bool) @ini_get('zlib.output_compression'); + $this->_zlib_oc = (bool) ini_get('zlib.output_compression'); $this->_compress_output = ( $this->_zlib_oc === FALSE && config_item('compress_output') === TRUE diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index d062103bd..de849c7e8 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -187,7 +187,7 @@ class CI_Cache_apc extends CI_Driver { */ public function is_supported() { - if ( ! extension_loaded('apc') OR ! (bool) @ini_get('apc.enabled')) + if ( ! extension_loaded('apc') OR ! ini_get('apc.enabled')) { log_message('debug', 'The APC PHP extension must be loaded to use APC Cache.'); return FALSE; diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 93c19de5e..3c3c49e78 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -401,7 +401,7 @@ class CI_Email { $this->_smtp_auth = ! ($this->smtp_user === '' && $this->smtp_pass === ''); } - $this->_safe_mode = ( ! is_php('5.4') && (bool) @ini_get('safe_mode')); + $this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode')); $this->charset = strtoupper($this->charset); log_message('debug', 'Email Class Initialized'); diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 983d832fd..4939b158c 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -1255,7 +1255,7 @@ class CI_Upload { } } - if ((bool) @ini_get('safe_mode') === FALSE && function_usable('shell_exec')) + if ( ! ini_get('safe_mode') && function_usable('shell_exec')) { $mime = @shell_exec($cmd); if (strlen($mime) > 0) |