diff options
Diffstat (limited to 'ext/fileinfo/libmagic/funcs.c')
-rw-r--r-- | ext/fileinfo/libmagic/funcs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c index f9a9ab6c9b..db8877e0d5 100644 --- a/ext/fileinfo/libmagic/funcs.c +++ b/ext/fileinfo/libmagic/funcs.c @@ -527,11 +527,9 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) zend_string *repl; size_t rep_cnt = 0; - (void)setlocale(LC_CTYPE, "C"); - opts |= PCRE2_MULTILINE; convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts); - if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) { + if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) { zval_ptr_dtor(&patt); rep_cnt = -1; goto out; @@ -553,7 +551,6 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) zend_string_release_ex(res, 0); out: - (void)setlocale(LC_CTYPE, ""); return rep_cnt; } |