Skip to content

Commit 8c3d279

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80644: ResourceBundle::get() doesn't reset error state
2 parents a6e8ebf + 05d1680 commit 8c3d279

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ext/intl/resourcebundle/resourcebundle_class.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ static void resourcebundle_array_fetch(zend_object *object, zval *offset, zval *
171171
char *pbuf;
172172
ResourceBundle_object *rb;
173173

174-
intl_error_reset( NULL );
175174
rb = php_intl_resourcebundle_fetch_object(object);
175+
intl_error_reset(NULL);
176+
intl_error_reset(INTL_DATA_ERROR_P(rb));
176177

177178
if(Z_TYPE_P(offset) == IS_LONG) {
178179
is_numeric = 1;

ext/intl/tests/resourcebundle_individual.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ function ut_main() {
2828
$t = ut_resourcebundle_get( $r, 'nonexisting' );
2929
$str_res .= debug( $t );
3030

31+
// Make sure accessing existing after non-existing works.
32+
$t = ut_resourcebundle_get( $r, 'teststring' );
33+
$str_res .= debug( $t );
34+
3135
return $str_res;
3236
}
3337
include_once( 'ut_common.inc' );
@@ -55,3 +59,5 @@ testtable: 3
5559
testarray: string 3
5660
NULL
5761
2: Cannot load resource element 'nonexisting': U_MISSING_RESOURCE_ERROR
62+
Hello World!
63+
0: U_ZERO_ERROR

0 commit comments

Comments
 (0)