Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ PHP NEWS
left busy for the next fetch, and rows delivered from a result another
statement took over. (KentarouTakeda)

- Intl:
. Fixed a double-free when IntlGregorianCalendar construction fails after
the ICU constructor adopts the TimeZone. (iliaal)

- Phar:
. Fixed Phar archives being automatically detected when ".phar" only occurs
in a directory name or is not a filename extension in an included file's
Expand Down
1 change: 0 additions & 1 deletion ext/intl/calendar/gregoriancalendar_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS, bool
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "error creating ICU "
"GregorianCalendar from time zone and locale");
delete tz;
if (!is_constructor) {
zval_ptr_dtor(return_value);
RETVAL_NULL();
Expand Down
21 changes: 21 additions & 0 deletions ext/intl/tests/gregoriancalendar_adopt_timezone.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
IntlGregorianCalendar timezone-and-locale constructor adopts the TimeZone
--EXTENSIONS--
intl
--INI--
date.timezone=UTC
--FILE--
<?php

$cal = new IntlGregorianCalendar(new DateTimeZone('Europe/Amsterdam'), 'en_US');
echo $cal->getTimeZone()->getID(), "\n";
echo $cal->getType(), "\n";

$cal2 = IntlGregorianCalendar::createInstance('UTC', 'en_US');
echo $cal2->getTimeZone()->getID(), "\n";

?>
--EXPECT--
Europe/Amsterdam
gregorian
UTC
Loading