Fixed bug #80644: ResourceBundle::get() doesn't reset error state

This commit is contained in:
Nikita Popov 2021-01-19 15:20:01 +01:00
parent 1bdd8f7ae4
commit 05d168013a
3 changed files with 12 additions and 1 deletions

4
NEWS
View File

@ -33,6 +33,10 @@ PHP NEWS
. Fixed bug #80560 (Strings containing only a base prefix return 0 object).
(girgias)
- Intl:
. Fixed bug #80644 (Missing resource causes subsequent get() calls to fail).
(Nikita)
- MySQLi:
. Fixed bug #67983 (mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to
interpret bit columns). (Nikita)

View File

@ -171,8 +171,9 @@ static void resourcebundle_array_fetch(zend_object *object, zval *offset, zval *
char *pbuf;
ResourceBundle_object *rb;
intl_error_reset( NULL );
rb = php_intl_resourcebundle_fetch_object(object);
intl_error_reset(NULL);
intl_error_reset(INTL_DATA_ERROR_P(rb));
if(Z_TYPE_P(offset) == IS_LONG) {
is_numeric = 1;

View File

@ -28,6 +28,10 @@ function ut_main() {
$t = ut_resourcebundle_get( $r, 'nonexisting' );
$str_res .= debug( $t );
// Make sure accessing existing after non-existing works.
$t = ut_resourcebundle_get( $r, 'teststring' );
$str_res .= debug( $t );
return $str_res;
}
include_once( 'ut_common.inc' );
@ -55,3 +59,5 @@ testtable: 3
testarray: string 3
NULL
2: Cannot load resource element 'nonexisting': U_MISSING_RESOURCE_ERROR
Hello World!
0: U_ZERO_ERROR