mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #76512: \w no longer includes unicode characters
The migration from PCRE to PCRE2 missed to rename once occurrence of `PCRE_UCP` to `PCRE2_UCP`. We fix that. We also revert the changes to bug52971.phpt which had been incorrectly made in commit a5bc5ae[1]. [1] <http://git.php.net/?p=php-src.git;a=commit;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d>
This commit is contained in:
parent
c2a3ab070b
commit
71d16feebb
4 changed files with 17 additions and 18 deletions
3
NEWS
3
NEWS
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -19,15 +19,8 @@ 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"
|
||||
|
@ -38,15 +31,8 @@ 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"
|
||||
|
|
10
ext/pcre/tests/bug76512.phpt
Normal file
10
ext/pcre/tests/bug76512.phpt
Normal file
|
@ -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===
|
Loading…
Add table
Add a link
Reference in a new issue