mirror of
https://github.com/php/php-src.git
synced 2026-04-27 01:48:26 +02:00
23e25f3319
When advancing after empty matches, php_pcre_match_impl() as well as php_pcre_replace_impl() always have to advance to the next code point when the u modifier is given, instead of to the next byte.
14 lines
354 B
PHP
14 lines
354 B
PHP
--TEST--
|
|
Bug #53823 - preg_replace: * qualifier on unicode replace garbles the string
|
|
--FILE--
|
|
<?php
|
|
var_dump(preg_replace('/[^\pL\pM]*/iu', '', 'áéíóú'));
|
|
// invalid UTF-8
|
|
var_dump(preg_replace('/[^\pL\pM]*/iu', '', "\xFCáéíóú"));
|
|
var_dump(preg_replace('/[^\pL\pM]*/iu', '', "áéíóú\xFC"));
|
|
?>
|
|
--EXPECT--
|
|
string(10) "áéíóú"
|
|
NULL
|
|
NULL
|