Skip to content

Commit e44ccde

Browse files
committed
"C" is the default locale
1 parent 3159a96 commit e44ccde

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ext/pcre/php_pcre.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,13 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
262262
if (pce->locale == BG(locale_string) ||
263263
(pce->locale && BG(locale_string) &&
264264
pce->locale->len == BG(locale_string)->len &&
265-
!memcmp(pce->locale->val, BG(locale_string)->val, pce->locale->len))) {
265+
!memcmp(pce->locale->val, BG(locale_string)->val, pce->locale->len)) ||
266+
(!pce->locale &&
267+
BG(locale_string)->len == 1 &&
268+
BG(locale_string)->val[0] == 'C') ||
269+
(!BG(locale_string) &&
270+
pce->locale->len == 1 &&
271+
pce->locale->val[0] == 'C')) {
266272
return pce;
267273
}
268274
#else

0 commit comments

Comments
 (0)