mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix bug #78804 - Segmentation fault in Locale::filterMatches
This commit is contained in:
commit
ad0a3f2886
2 changed files with 15 additions and 2 deletions
|
@ -1259,7 +1259,7 @@ PHP_FUNCTION(locale_filter_matches)
|
|||
if( boolCanonical ){
|
||||
/* canonicalize loc_range */
|
||||
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize loc_range" , 0 );
|
||||
RETURN_FALSE;
|
||||
|
@ -1267,7 +1267,7 @@ PHP_FUNCTION(locale_filter_matches)
|
|||
|
||||
/* canonicalize lang_tag */
|
||||
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
|
||||
RETURN_FALSE;
|
||||
|
|
13
ext/intl/tests/bug78804.phpt
Normal file
13
ext/intl/tests/bug78804.phpt
Normal file
|
@ -0,0 +1,13 @@
|
|||
--TEST--
|
||||
Bug #78804: Segmentation fault in Locale::filterMatches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (Locale::filterMatches('en-US', 'und', true)) {
|
||||
echo 'Matches';
|
||||
} else {
|
||||
echo 'Not matches';
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Not matches
|
Loading…
Add table
Add a link
Reference in a new issue