diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 50838de7ed8fa..1c4ba327bd83c 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -149,7 +149,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 */ diff --git a/ext/intl/tests/locale/bug72809.phpt b/ext/intl/tests/locale/bug72809.phpt new file mode 100644 index 0000000000000..98dc7d39694da --- /dev/null +++ b/ext/intl/tests/locale/bug72809.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #72809 (Locale::lookup() wrong result with canonicalize option) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(5) "en_us" +string(5) "en_US" +string(5) "en_us"