]> granicus.if.org Git - php/commitdiff
"C" is the default locale
authorDmitry Stogov <dmitry@zend.com>
Thu, 16 Apr 2015 18:44:50 +0000 (21:44 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 16 Apr 2015 18:44:50 +0000 (21:44 +0300)
ext/pcre/php_pcre.c

index 117d288bb75765709c933cb11e6f5667b67961f0..4c29905d2fa546bb14b664d7a0e08d77c329f500 100644 (file)
@@ -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