mirror of
https://github.com/php/php-src.git
synced 2026-04-29 19:23:22 +02:00
Merge branch 'PHP-8.0'
* PHP-8.0: Fix #72809: Locale::lookup() wrong result with canonicalize option
This commit is contained in:
@@ -146,7 +146,7 @@ static zend_off_t getStrrtokenPos(char* str, zend_off_t savedPos)
|
||||
zend_off_t i;
|
||||
|
||||
for(i=savedPos-1; i>=0; i--) {
|
||||
if(isIDSeparator(*(str+i)) ){
|
||||
if(isIDSeparator(*(str+i)) || isKeywordSeparator(*(str+i))){
|
||||
/* delimiter found; check for singleton */
|
||||
if(i>=2 && isIDSeparator(*(str+i-2)) ){
|
||||
/* a singleton; so send the position of token before the singleton */
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72809 (Locale::lookup() wrong result with canonicalize option)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die("skip intl extension not avaible");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
Locale::lookup(['en', 'en-US'], 'en-US-u-cu-EUR-tz-deber-fw-mon', true),
|
||||
Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', false),
|
||||
Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', true),
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "en_us"
|
||||
string(5) "en_US"
|
||||
string(5) "en_us"
|
||||
Reference in New Issue
Block a user