summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 117d288bb7..4c29905d2f 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -262,7 +262,13 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
if (pce->locale == BG(locale_string) ||
(pce->locale && BG(locale_string) &&
pce->locale->len == BG(locale_string)->len &&
- !memcmp(pce->locale->val, BG(locale_string)->val, pce->locale->len))) {
+ !memcmp(pce->locale->val, BG(locale_string)->val, pce->locale->len)) ||
+ (!pce->locale &&
+ BG(locale_string)->len == 1 &&
+ BG(locale_string)->val[0] == 'C') ||
+ (!BG(locale_string) &&
+ pce->locale->len == 1 &&
+ pce->locale->val[0] == 'C')) {
return pce;
}
#else