Skip to content

Commit e79046f

Browse files
authored
Fix redundant ZSTR_VAL condition in php_date.c (#8753)
ZSTR_VAL can never be NULL as zend_string.val is a char[1] which will always decay to a non-nullable pointer. This fails with -Werror on newer gcc versions.
1 parent 3f7ec69 commit e79046f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t
477477
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
478478
static PHP_INI_MH(OnUpdate_date_timezone)
479479
{
480-
if (new_value && ZSTR_VAL(new_value) && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) {
480+
if (new_value && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) {
481481
php_error_docref(
482482
NULL, E_WARNING,
483483
"Invalid date.timezone value '%s', using '%s' instead",

0 commit comments

Comments
 (0)