summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Lacerda <pslacerda@gmail.com>2018-02-06 23:55:31 -0300
committerNikita Popov <nikita.ppv@gmail.com>2018-02-10 19:29:47 +0100
commitfddd7e38bd01bc6dbc473166dd6f92e9f81a6eab (patch)
tree0d15b8bb53fbff0adf8506c705b375702d6cb94e
parent01f7998db0ddf620233dbfe35d3344758876d78d (diff)
downloadphp-git-fddd7e38bd01bc6dbc473166dd6f92e9f81a6eab.tar.gz
Fixed bug #75928
-rw-r--r--NEWS4
-rw-r--r--ext/date/php_date.c6
-rw-r--r--ext/date/tests/bug75928.phpt9
3 files changed, 16 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 3561319f4d..29806f95c8 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index d7c243046d..4f92eabe38 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -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;
}
diff --git a/ext/date/tests/bug75928.phpt b/ext/date/tests/bug75928.phpt
new file mode 100644
index 0000000000..703df52031
--- /dev/null
+++ b/ext/date/tests/bug75928.phpt
@@ -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)