From 27e9c05e8108fe6c184178997176896fb91a3451 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 26 Dec 2018 17:20:13 +0100 Subject: Remove preg_options param from pcre_get_compiled_regex() This parameter is always zero and not necessary to call pcre2_match. I'm leaving the parameter behind on the _ex() variant, so the preg_flags are still accessible in some way. --- ext/fileinfo/libmagic/softmagic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/fileinfo/libmagic') diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index d37ce0d255..a270f97eca 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -423,7 +423,7 @@ private int check_fmt(struct magic_set *ms, const char *fmt) { pcre2_code *pce; - uint32_t re_options, capture_count; + uint32_t capture_count; int rv = -1; zend_string *pattern; @@ -432,12 +432,12 @@ check_fmt(struct magic_set *ms, const char *fmt) (void)setlocale(LC_CTYPE, "C"); pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0); - if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) { + if ((pce = pcre_get_compiled_regex(pattern, &capture_count)) == NULL) { rv = -1; } else { pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce); if (match_data) { - rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0; + rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0; php_pcre_free_match_data(match_data); } } -- cgit v1.2.1