summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-02-10 19:30:57 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-02-10 19:30:57 +0100
commitee3f3a9d75393585c10df65a7d5bdd0512994bb8 (patch)
tree22c7edf09a624689cb9a42f0d774b81e86e01d6b
parente87283fa3f94b53a139f3bcb5ff8a8030594b8dc (diff)
parentfddd7e38bd01bc6dbc473166dd6f92e9f81a6eab (diff)
downloadphp-git-ee3f3a9d75393585c10df65a7d5bdd0512994bb8.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
-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 40240283c8..fd26241ba9 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,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)
+
- LDAP:
. Fixed bug #49876 (Fix LDAP path lookup on 64-bit distros). (dzuelke)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index b65675cf62..ca65467456 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -4741,14 +4741,14 @@ 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;
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(what)
- Z_PARAM_STRING(option, option_len)
+ Z_PARAM_STRING_EX(option, option_len, 1, 0)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
/* Extra validation */
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)