summaryrefslogtreecommitdiff
path: root/ext/fileinfo/libmagic
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-12-26 17:20:13 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-12-26 17:20:13 +0100
commit27e9c05e8108fe6c184178997176896fb91a3451 (patch)
treefc2d55695b51206ee95c6f42fadf07285a19498f /ext/fileinfo/libmagic
parentfc30c0f7adbddd491266fdbf80427c348d249e01 (diff)
downloadphp-git-27e9c05e8108fe6c184178997176896fb91a3451.tar.gz
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.
Diffstat (limited to 'ext/fileinfo/libmagic')
-rw-r--r--ext/fileinfo/libmagic/softmagic.c6
1 files changed, 3 insertions, 3 deletions
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);
}
}