summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-19 15:20:01 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-19 15:20:55 +0100
commit05d168013a2be5e85c43f0d6c92aeab899e7952b (patch)
tree38332f7dc2fbb743f8f25924cbd7b9df61dc8c92
parent1bdd8f7ae43874876368d97dd89d88a517a2e80b (diff)
downloadphp-git-05d168013a2be5e85c43f0d6c92aeab899e7952b.tar.gz
Fixed bug #80644: ResourceBundle::get() doesn't reset error state
-rw-r--r--NEWS4
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c3
-rw-r--r--ext/intl/tests/resourcebundle_individual.phpt6
3 files changed, 12 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index aea46517a1..330d78da75 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 98a33b9284..fd763dcf37 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