Also switch to uint64_t as that's used on master and makes the code
simpler to fix.
Closes GH-20807.
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
Mirror the mdata_used protection pattern from php_pcre_replace_func_impl
in php_pcre_match_impl, php_pcre_replace_impl, php_pcre_split_impl,
and php_pcre_grep_impl.
close GH-21291
Newer PCRE2 rejects \K in lookarounds at compile time, so the
negative-length match code path can no longer be triggered from
userland PHP. The PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK flag that would
re-enable it is only settable via the C compile context API.
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.
Fixes GH-20762
Closes GH-20935
Just compare against github.event.pull_request.base.sha. When GitHub creates
hidden merge commits, it doesn't make sense to compare against the base anyway.
Closes GH-21306
Add support for new functions present in recent libsodium versions:
- Functions for IP address encryption:
- sodium_crypto_ipcrypt_*
- sodium_bin2ip/sodium_ip2bin helpers
- Extendable output functions:
- SHAKE128/SHAKE256
- TurboSHAKE128/TurboSHAKE256
Fix pcre2_code leak when pcre2_pattern_info() fails after a successful
pcre2_compile(), and fix match_sets/match_data/marks leak when
offsets[1] < offsets[0] in php_pcre_match_impl().
close GH-21298
internal refactorings:
- pcntl_signal_get_handler() max signals handling simplification,
reusing the num_signals global.
- pcntl_alarm() accepts a zend_long (signed) but passes it to alarm(),
which takes an unsigned int. Negative values silently wrap to large
unsigned values, scheduling an alarm far in the future instead of
raising an error. Also reject large values above unsigned long
max value.
close GH-21282
Instead of hardcoding the file extensions for shared PHP extensions
(which in most cases are '.so', or '.dll'), this uses file extension for
the current PHP build as it was defined during the configure/build
phase. There can be systems where some other file extension is used for
shared modules.
When a PCRE execution error occurs (e.g. malformed UTF-8 with /u
modifier), preg_grep() was returning a partial result array containing
only the entries processed before the error. All other preg_* functions
return false on execution errors.
After the match loop, check PCRE_G(error_code) and if an error
occurred, destroy the partial array and return false instead.
Fixes GH-11936