mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: replace str_ireplace() with in_array()
php > ini_set('display_errors', '1'); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', 1); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', true); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', 'true'); php > var_dump(ini_get('display_errors')); string(4) "true"
This commit is contained in:
parent
f26b9dc85b
commit
f251a3c750
@ -130,11 +130,11 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
|
||||
$view = 'production.php';
|
||||
|
||||
if (
|
||||
str_ireplace(
|
||||
['off', 'none', 'no', 'false', 'null', '0'],
|
||||
'',
|
||||
ini_get('display_errors')
|
||||
) !== ''
|
||||
in_array(
|
||||
strtolower(ini_get('display_errors')),
|
||||
['1', 'true', 'on', 'yes'],
|
||||
true
|
||||
)
|
||||
) {
|
||||
$view = 'error_exception.php';
|
||||
}
|
||||
|
@ -254,11 +254,11 @@ class Exceptions
|
||||
$templatePath = rtrim($templatePath, '\\/ ') . DIRECTORY_SEPARATOR;
|
||||
|
||||
if (
|
||||
str_ireplace(
|
||||
['off', 'none', 'no', 'false', 'null', '0'],
|
||||
'',
|
||||
ini_get('display_errors')
|
||||
) !== ''
|
||||
in_array(
|
||||
strtolower(ini_get('display_errors')),
|
||||
['1', 'true', 'on', 'yes'],
|
||||
true
|
||||
)
|
||||
) {
|
||||
$view = 'error_exception.php';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user