summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug53823.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/tests/bug53823.phpt')
-rw-r--r--ext/pcre/tests/bug53823.phpt13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug53823.phpt b/ext/pcre/tests/bug53823.phpt
new file mode 100644
index 0000000000..c1d8f999e0
--- /dev/null
+++ b/ext/pcre/tests/bug53823.phpt
@@ -0,0 +1,13 @@
+--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