Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for pcre2 10.38 (PHP 8.0+) #7603

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ext/pcre/php_pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ static void php_pcre_efree(void *block, void *data)
efree(block);
}

#ifdef PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
/* pcre 10.38 needs PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK, disabled by default */
#define PHP_PCRE_DEFAULT_EXTRA_COPTIONS PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
#else
#define PHP_PCRE_DEFAULT_EXTRA_COPTIONS 0
#endif

#define PHP_PCRE_PREALLOC_MDATA_SIZE 32

static void php_pcre_init_pcre2(uint8_t jit)
Expand All @@ -213,6 +220,8 @@ static void php_pcre_init_pcre2(uint8_t jit)
}
}

pcre2_set_compile_extra_options(cctx, PHP_PCRE_DEFAULT_EXTRA_COPTIONS);

if (!mctx) {
mctx = pcre2_match_context_create(gctx);
if (!mctx) {
Expand Down