Skip to content
Merged
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
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ PHP NEWS
- Intl:
. Fixed malformed ResourceBundle::get() error message when fallback is
disabled. (Weilin Du)
. Fixed IntlTimeZone::getDisplayName() to synchronize object error state
for invalid display types. (Weilin Du)
. Added IntlNumberRangeFormatter class to format an interval of two numbers
with a given skeleton, locale, collapse type and identity fallback.
(BogdanUngureanu)
Expand Down
2 changes: 2 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. --with-pic is now --enable-pic. The old flag will result in an error.
. Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use
HAVE_STRUCT_STAT_ST_BLOCKS).
. Added a new configure option --disable-apache2-conf to prevent apxs from
editing httpd.conf during installation.

- Windows build system changes:
. Function SETUP_OPENSSL() doesn't accept 6th argument anymore and doesn't
Expand Down
4 changes: 4 additions & 0 deletions ext/intl/tests/timezone_getDisplayName_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ intl
$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
var_dump($tz->getDisplayName(false, -1));
echo intl_get_error_message(), PHP_EOL;
var_dump($tz->getErrorCode());
echo $tz->getErrorMessage(), PHP_EOL;

?>
--EXPECT--
bool(false)
IntlTimeZone::getDisplayName(): wrong display type: U_ILLEGAL_ARGUMENT_ERROR
int(1)
IntlTimeZone::getDisplayName(): wrong display type: U_ILLEGAL_ARGUMENT_ERROR
7 changes: 4 additions & 3 deletions ext/intl/timezone/timezone_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,22 +483,23 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
RETURN_THROWS();
}

TIMEZONE_METHOD_FETCH_OBJECT;

bool found = false;
for (int i = 0; !found && i < sizeof(display_types)/sizeof(*display_types); i++) {
if (display_types[i] == display_type)
found = true;
}
if (!found) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "wrong display type");
intl_errors_set(TIMEZONE_ERROR_P(to), U_ILLEGAL_ARGUMENT_ERROR,
"wrong display type");
RETURN_FALSE;
}

if (!locale_str) {
locale_str = intl_locale_get_default();
}

TIMEZONE_METHOD_FETCH_OBJECT;

UnicodeString result;
to->utimezone->getDisplayName((UBool)daylight, (TimeZone::EDisplayType)display_type,
Locale::createFromName(locale_str), result);
Expand Down
11 changes: 10 additions & 1 deletion sapi/apache2handler/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ PHP_ARG_WITH([apxs2],
[no],
[no])

PHP_ARG_ENABLE([apache2-conf],
[whether to activate the PHP module in Apache httpd.conf via apxs],
[AS_HELP_STRING([--disable-apache2-conf],
[Do not activate the PHP module in the Apache httpd.conf during installation
via apxs. Useful when installing into a staging directory or when Apache
configuration is managed separately (e.g., via a2enmod).])],
[yes],
[no])

if test "$PHP_APXS2" != "no"; then
AS_VAR_IF([PHP_APXS2], [yes], [
APXS=apxs
Expand Down Expand Up @@ -69,7 +78,7 @@ if test "$PHP_APXS2" != "no"; then
[AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])])

APXS_LIBEXECDIR='$(INSTALL_ROOT)'$($APXS -q LIBEXECDIR)
if test -z $($APXS -q SYSCONFDIR); then
if test -z $($APXS -q SYSCONFDIR) || test "$PHP_APACHE2_CONF" = "no"; then
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-i -n php"
Expand Down
Loading