Skip to content

Commit

Permalink
Fixed bug #75928
Browse files Browse the repository at this point in the history
  • Loading branch information
pslacerda authored and nikic committed Feb 10, 2018
1 parent 01f7998 commit fddd7e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ PHP NEWS
. Fixed bug #75882 (a simple way for segfaults in threadsafe php just with
configuration). (Anatol)

- Date:
. Fixed bug #75928 (Argument 2 for `DateTimeZone::listIdentifiers()` should
accept `null`). (Pedro Lacerda)

- PGSQL:
. Fixed #75838 (Memory leak in pg_escape_bytea()). (ard_1 at mail dot ru)

Expand Down
6 changes: 3 additions & 3 deletions ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -4701,11 +4701,11 @@ PHP_FUNCTION(timezone_identifiers_list)
const timelib_tzdb *tzdb;
const timelib_tzdb_index_entry *table;
int i, item_count;
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
char *option = NULL;
size_t option_len = 0;
size_t option_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls", &what, &option, &option_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls!", &what, &option, &option_len) == FAILURE) {
RETURN_FALSE;
}

Expand Down
9 changes: 9 additions & 0 deletions ext/date/tests/bug75928.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--TEST--
Bug #75928: Argument 2 for `DateTimeZone::listIdentifiers()` should accept `null`
--FILE--
<?php
declare(strict_types=1);
var_dump(is_array(DateTimeZone::listIdentifiers(\DateTimeZone::ALL, null)));
?>
--EXPECT--
bool(true)

0 comments on commit fddd7e3

Please sign in to comment.