diff options
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 6ca165694c..0e4c0e8f61 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -77,9 +77,6 @@ static int _php_free_pcre_cache(void *data) { pcre_cache_entry *pce = (pcre_cache_entry *) data; pefree(pce->re, 1); -#if HAVE_SETLOCALE - pefree((void*)pce->tables, 1); -#endif return 1; } @@ -166,10 +163,6 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_ int regex_len; int do_study = 0; int poptions = 0; - unsigned const char *tables = NULL; -#if HAVE_SETLOCALE - char *locale = setlocale(LC_CTYPE, NULL); -#endif pcre_cache_entry *pce; pcre_cache_entry new_entry; PCRE_LS_FETCH(); @@ -178,15 +171,9 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_ back the compiled pattern, otherwise go on and compile it. */ regex_len = strlen(regex); if (zend_hash_find(&PCRE_G(pcre_cache), regex, regex_len+1, (void **)&pce) == SUCCESS) { -#if HAVE_SETLOCALE - if (!strcmp(pce->locale, locale)) { -#endif - extra = pce->extra; - *preg_options = pce->preg_options; - return pce->re; -#if HAVE_SETLOCALE - } -#endif + extra = pce->extra; + *preg_options = pce->preg_options; + return pce->re; } p = regex; @@ -231,7 +218,7 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_ *preg_options = 0; /* Parse through the options, setting appropriate flags. Display - a warning if we encounter an unknown modifier. */ + a warning if we encounter an unknown option. */ while (*pp != 0) { switch (*pp++) { /* Perl compatible options */ @@ -255,23 +242,18 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_ break; default: - zend_error(E_WARNING, "Unknown modifier '%c'", pp[-1]); + zend_error(E_WARNING, "Unknown option '%c'", pp[-1]); efree(pattern); return NULL; } } - -#if HAVE_SETLOCALE - if (strcmp(locale, "C")) - tables = pcre_maketables(); -#endif /* Compile pattern and display a warning if compilation failed. */ re = pcre_compile(pattern, coptions, &error, &erroffset, - tables); + NULL); if (re == NULL) { zend_error(E_WARNING, "Compilation failed: %s at offset %d\n", error, erroffset); @@ -296,10 +278,6 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_ new_entry.re = re; new_entry.extra = extra; new_entry.preg_options = poptions; -#if HAVE_SETLOCALE - new_entry.locale = locale; - new_entry.tables = tables; -#endif zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry, sizeof(pcre_cache_entry), NULL); |