Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ PHP NEWS
. pcntl_exec() now throws a ValueError if the $args array is not a list
array. (Weilin Du)

- PCRE:
. Added the PREG_THROW_ON_ERROR flag to make the preg_*() functions throw a
\PregException on any PCRE error. (aldemeery)

- PDO_DBLIB:
. Added dblib_handle_check_liveness handler. (freddy77)

Expand Down
24 changes: 24 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,20 @@ PHP 8.6 UPGRADE NOTES
. Added TLS external PSK support for streams with new strem context options:
psk_client_cb and psk_server_cb. This allows setting and receiving PSK.

- PCRE:
. Added the PREG_THROW_ON_ERROR flag. When passed to a preg_*() function that
accepts a $flags argument, any PCRE error reported by preg_last_error()
throws a \PregException instead of emitting a warning or returning
false/null. The exception's code and message are exactly what
preg_last_error() and preg_last_error_msg() report for the same call: the
flag changes how an error is delivered, not the error itself. This covers
both compilation errors (such as a malformed pattern) and execution errors
(such as an exhausted backtrack limit or malformed UTF-8 input under the /u
modifier). preg_replace() and preg_filter() gained a $flags parameter to
accept it. As on the non-flag path, by-reference outputs (the $matches and
$count arguments) may already have been written when the \PregException is
thrown, so a catch block should not assume they are left untouched.

- Phar:
. Overriding the getMTime() and getPathname() methods of SplFileInfo now
influences the result of the phar buildFrom family of functions.
Expand Down Expand Up @@ -373,6 +387,10 @@ PHP 8.6 UPGRADE NOTES
. Output of openssl_x509_parse() contains criticalExtensions listing all
critical certificate extensions.

- PCRE:
. preg_replace() and preg_filter() now accept an optional $flags argument
(for PREG_THROW_ON_ERROR).

- PDO_DBLIB:
. When using persistent connections, there is now a liveness check in the
constructor.
Expand Down Expand Up @@ -443,6 +461,9 @@ PHP 8.6 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/tls_session_resumption
. Openssl\Psk

- PCRE:
. PregException

- Standard:
. enum SortDirection
RFC: https://wiki.php.net/rfc/sort_direction_enum
Expand Down Expand Up @@ -502,6 +523,9 @@ PHP 8.6 UPGRADE NOTES
. CURL_SEEKFUNC_FAIL.
. CURL_SEEKFUNC_CANTSEEK.

- PCRE:
. PREG_THROW_ON_ERROR.

- Sockets:
. TCP_USER_TIMEOUT (Linux only).
. AF_UNSPEC.
Expand Down
2 changes: 1 addition & 1 deletion ext/fileinfo/libmagic/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)

opts |= PCRE2_MULTILINE;
pattern = convert_libmagic_pattern(pat, strlen(pat), opts);
pce = pcre_get_compiled_regex_cache_ex(pattern, 0);
pce = pcre_get_compiled_regex_cache_ex(pattern, 0, 0);
zend_string_release_ex(pattern, 0);
if (pce == NULL) {
rep_cnt = -1;
Expand Down
2 changes: 1 addition & 1 deletion ext/fileinfo/libmagic/softmagic.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ check_fmt(struct magic_set *ms, const char *fmt)
return 0;

pattern = ZSTR_INIT_LITERAL("~%[-0-9\\.]*s~", 0);
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0, 0)) == NULL) {
rv = -1;
} else {
pcre2_code *re = php_pcre_pce_re(pce);
Expand Down
Loading
Loading