diff --git a/NEWS b/NEWS index 4fbc7e89eb11..c6fa558db81e 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c340ba64833c..dd4b9840aee3 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -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 diff --git a/ext/intl/tests/timezone_getDisplayName_error.phpt b/ext/intl/tests/timezone_getDisplayName_error.phpt index ca845b2830ed..032b22e50908 100644 --- a/ext/intl/tests/timezone_getDisplayName_error.phpt +++ b/ext/intl/tests/timezone_getDisplayName_error.phpt @@ -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 diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 29180f9caa2d..8f70a87487ac 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -483,13 +483,16 @@ 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; } @@ -497,8 +500,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) 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); diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index e335721f19e9..3001a4d61d9a 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -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 @@ -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"