Skip to content

Commit f627474

Browse files
committed
Don't use error suppression on ini_get() either
1 parent bb3edf1 commit f627474

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

system/core/Common.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function is_php($version = '5.3.0')
8383
function is_really_writable($file)
8484
{
8585
// If we're on a Unix server with safe_mode off we call is_writable
86-
if (DIRECTORY_SEPARATOR === '/' && (is_php('5.4') OR (bool) @ini_get('safe_mode') === FALSE))
86+
if (DIRECTORY_SEPARATOR === '/' && (is_php('5.4') OR ! ini_get('safe_mode')))
8787
{
8888
return is_writable($file);
8989
}
@@ -600,7 +600,7 @@ function _exception_handler($severity, $message, $filepath, $line)
600600
$_error->log_exception($severity, $message, $filepath, $line);
601601

602602
// Should we display the error?
603-
if ((bool) ini_get('display_errors') === TRUE)
603+
if (ini_get('display_errors'))
604604
{
605605
$_error->show_php_error($severity, $message, $filepath, $line);
606606
}
@@ -775,9 +775,9 @@ function function_usable($function_name)
775775
{
776776
if (extension_loaded('suhosin'))
777777
{
778-
$_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
778+
$_suhosin_func_blacklist = explode(',', trim(ini_get('suhosin.executor.func.blacklist')));
779779

780-
if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
780+
if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && ini_get('suhosin.executor.disable_eval'))
781781
{
782782
$_suhosin_func_blacklist[] = 'eval';
783783
}

system/core/Loader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,7 @@ protected function _ci_load($_ci_data)
901901
// If the PHP installation does not support short tags we'll
902902
// do a little string replacement, changing the short tags
903903
// to standard PHP echo statements.
904-
if ( ! is_php('5.4') && (bool) @ini_get('short_open_tag') === FALSE
905-
&& config_item('rewrite_short_tags') === TRUE && function_usable('eval')
906-
)
904+
if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE && function_usable('eval'))
907905
{
908906
echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
909907
}

system/core/Output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class CI_Output {
120120
*/
121121
public function __construct()
122122
{
123-
$this->_zlib_oc = (bool) @ini_get('zlib.output_compression');
123+
$this->_zlib_oc = (bool) ini_get('zlib.output_compression');
124124
$this->_compress_output = (
125125
$this->_zlib_oc === FALSE
126126
&& config_item('compress_output') === TRUE

system/libraries/Cache/drivers/Cache_apc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function get_metadata($id)
187187
*/
188188
public function is_supported()
189189
{
190-
if ( ! extension_loaded('apc') OR ! (bool) @ini_get('apc.enabled'))
190+
if ( ! extension_loaded('apc') OR ! ini_get('apc.enabled'))
191191
{
192192
log_message('debug', 'The APC PHP extension must be loaded to use APC Cache.');
193193
return FALSE;

system/libraries/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function __construct($config = array())
401401
$this->_smtp_auth = ! ($this->smtp_user === '' && $this->smtp_pass === '');
402402
}
403403

404-
$this->_safe_mode = ( ! is_php('5.4') && (bool) @ini_get('safe_mode'));
404+
$this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode'));
405405
$this->charset = strtoupper($this->charset);
406406

407407
log_message('debug', 'Email Class Initialized');

system/libraries/Upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ protected function _file_mime_type($file)
12551255
}
12561256
}
12571257

1258-
if ((bool) @ini_get('safe_mode') === FALSE && function_usable('shell_exec'))
1258+
if ( ! ini_get('safe_mode') && function_usable('shell_exec'))
12591259
{
12601260
$mime = @shell_exec($cmd);
12611261
if (strlen($mime) > 0)

0 commit comments

Comments
 (0)