diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/pcre/php_pcre.c | 4 | ||||
-rw-r--r-- | ext/pcre/tests/bug52971.phpt | 18 | ||||
-rw-r--r-- | ext/pcre/tests/bug76512.phpt | 10 |
4 files changed, 17 insertions, 18 deletions
@@ -6,6 +6,9 @@ PHP NEWS . Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to non-blocking). (Nikita) +- PCRE: + . Fixed bug #76512 (\w no longer includes unicode characters). (cmb) + - Standard: . Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys). (Laruence) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index ffecc39422..9e1a5a6a50 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -672,8 +672,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) case 'u': coptions |= PCRE2_UTF; /* In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII characters, even in UTF-8 mode. However, this can be changed by setting - the PCRE_UCP option. */ -#ifdef PCRE_UCP + the PCRE2_UCP option. */ +#ifdef PCRE2_UCP coptions |= PCRE2_UCP; #endif break; diff --git a/ext/pcre/tests/bug52971.phpt b/ext/pcre/tests/bug52971.phpt index 130fbf31a2..552c97e357 100644 --- a/ext/pcre/tests/bug52971.phpt +++ b/ext/pcre/tests/bug52971.phpt @@ -19,17 +19,10 @@ var_dump($match); --EXPECT-- array(1) { [0]=> - array(2) { + array(1) { [0]=> array(2) { [0]=> - string(6) "wasser" - [1]=> - int(17) - } - [1]=> - array(2) { - [0]=> string(6) "Wasser" [1]=> int(61) @@ -38,17 +31,10 @@ array(1) { } array(1) { [0]=> - array(2) { + array(1) { [0]=> array(2) { [0]=> - string(8) "ßwasser" - [1]=> - int(15) - } - [1]=> - array(2) { - [0]=> string(7) " Wasser" [1]=> int(60) diff --git a/ext/pcre/tests/bug76512.phpt b/ext/pcre/tests/bug76512.phpt new file mode 100644 index 0000000000..cd14ad814d --- /dev/null +++ b/ext/pcre/tests/bug76512.phpt @@ -0,0 +1,10 @@ +--TEST--
+Bug #76512 (\w no longer includes unicode characters)
+--FILE--
+<?php
+var_dump(preg_match('/\w/u', 'ä'));
+?>
+===DONE===
+--EXPECT--
+int(1)
+===DONE===
|