@@ -401,32 +401,32 @@ static PHP_INI_MH(OnUpdateTimeout)
401
401
/* }}} */
402
402
403
403
/* {{{ php_get_display_errors_mode() helper function */
404
- static zend_uchar php_get_display_errors_mode (char * value , size_t value_length )
404
+ static zend_uchar php_get_display_errors_mode (zend_string * value )
405
405
{
406
406
zend_uchar mode ;
407
407
408
408
if (!value ) {
409
409
return PHP_DISPLAY_ERRORS_STDOUT ;
410
410
}
411
411
412
- if (value_length == 2 && ! strcasecmp ( "on" , value )) {
412
+ if (zend_string_equals_literal_ci ( value , "on" )) {
413
413
return PHP_DISPLAY_ERRORS_STDOUT ;
414
414
}
415
- if (value_length == 3 && ! strcasecmp ( "yes" , value )) {
415
+ if (zend_string_equals_literal_ci ( value , "yes" )) {
416
416
return PHP_DISPLAY_ERRORS_STDOUT ;
417
417
}
418
418
419
- if (value_length == 4 && ! strcasecmp ( "true" , value )) {
419
+ if (zend_string_equals_literal_ci ( value , "true" )) {
420
420
return PHP_DISPLAY_ERRORS_STDOUT ;
421
421
}
422
- if (value_length == 6 && ! strcasecmp (value , "stderr" )) {
422
+ if (zend_string_equals_literal_ci (value , "stderr" )) {
423
423
return PHP_DISPLAY_ERRORS_STDERR ;
424
424
}
425
- if (value_length == 6 && ! strcasecmp (value , "stdout" )) {
425
+ if (zend_string_equals_literal_ci (value , "stdout" )) {
426
426
return PHP_DISPLAY_ERRORS_STDOUT ;
427
427
}
428
428
429
- ZEND_ATOL (mode , value );
429
+ ZEND_ATOL (mode , ZSTR_VAL ( value ) );
430
430
if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR ) {
431
431
return PHP_DISPLAY_ERRORS_STDOUT ;
432
432
}
@@ -438,7 +438,7 @@ static zend_uchar php_get_display_errors_mode(char *value, size_t value_length)
438
438
/* {{{ PHP_INI_MH */
439
439
static PHP_INI_MH (OnUpdateDisplayErrors )
440
440
{
441
- PG (display_errors ) = php_get_display_errors_mode (ZSTR_VAL ( new_value ), ZSTR_LEN ( new_value ) );
441
+ PG (display_errors ) = php_get_display_errors_mode (new_value );
442
442
443
443
return SUCCESS ;
444
444
}
@@ -449,21 +449,17 @@ static PHP_INI_DISP(display_errors_mode)
449
449
{
450
450
zend_uchar mode ;
451
451
bool cgi_or_cli ;
452
- size_t tmp_value_length ;
453
- char * tmp_value ;
452
+ zend_string * temporary_value ;
454
453
455
454
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry -> modified ) {
456
- tmp_value = (ini_entry -> orig_value ? ZSTR_VAL (ini_entry -> orig_value ) : NULL );
457
- tmp_value_length = (ini_entry -> orig_value ? ZSTR_LEN (ini_entry -> orig_value ) : 0 );
455
+ temporary_value = (ini_entry -> orig_value ? ini_entry -> orig_value : NULL );
458
456
} else if (ini_entry -> value ) {
459
- tmp_value = ZSTR_VAL (ini_entry -> value );
460
- tmp_value_length = ZSTR_LEN (ini_entry -> value );
457
+ temporary_value = ini_entry -> value ;
461
458
} else {
462
- tmp_value = NULL ;
463
- tmp_value_length = 0 ;
459
+ temporary_value = NULL ;
464
460
}
465
461
466
- mode = php_get_display_errors_mode (tmp_value , tmp_value_length );
462
+ mode = php_get_display_errors_mode (temporary_value );
467
463
468
464
/* Display 'On' for other SAPIs instead of STDOUT or STDERR */
469
465
cgi_or_cli = (!strcmp (sapi_module .name , "cli" ) || !strcmp (sapi_module .name , "cgi" ) || !strcmp (sapi_module .name , "phpdbg" ));
0 commit comments