Browse Source

Use a copy of locale instead of the original. Fixes bug #19482.

migration/unlabaled-1.29.2
Andrei Zmievski 24 years ago
parent
commit
6863d70ef3
  1. 3
      ext/pcre/php_pcre.c

3
ext/pcre/php_pcre.c

@ -66,6 +66,7 @@ static void php_free_pcre_cache(void *data)
pefree(pce->re, 1);
#if HAVE_SETLOCALE
if ((void*)pce->tables) pefree((void*)pce->tables, 1);
pefree(pce->locale, 1);
#endif
}
@ -302,7 +303,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_
new_entry.extra = *extra;
new_entry.preg_options = poptions;
#if HAVE_SETLOCALE
new_entry.locale = locale;
new_entry.locale = pestrdup(locale, 1);
new_entry.tables = tables;
#endif
zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry,

Loading…
Cancel
Save