summaryrefslogtreecommitdiff
path: root/ext/intl
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-19 15:21:09 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-19 15:21:09 +0100
commit8c3d279cb3c839178e1d39823b2d4bb905b76c6b (patch)
treeed43f5bbd0cf840bbdb12c200bc11143d98acce8 /ext/intl
parenta6e8ebf99a5a41c92010a5f9ecf96bc444ac8900 (diff)
parent05d168013a2be5e85c43f0d6c92aeab899e7952b (diff)
downloadphp-git-8c3d279cb3c839178e1d39823b2d4bb905b76c6b.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80644: ResourceBundle::get() doesn't reset error state
Diffstat (limited to 'ext/intl')
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c3
-rw-r--r--ext/intl/tests/resourcebundle_individual.phpt6
2 files changed, 8 insertions, 1 deletions
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index ef82b2fd48..351c3278a7 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -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;
diff --git a/ext/intl/tests/resourcebundle_individual.phpt b/ext/intl/tests/resourcebundle_individual.phpt
index 46ce239e4d..46481dc0d6 100644
--- a/ext/intl/tests/resourcebundle_individual.phpt
+++ b/ext/intl/tests/resourcebundle_individual.phpt
@@ -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