summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/bug40685.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/tests/bug40685.phpt')
-rw-r--r--ext/mbstring/tests/bug40685.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/mbstring/tests/bug40685.phpt b/ext/mbstring/tests/bug40685.phpt
new file mode 100644
index 000000000..420b916bc
--- /dev/null
+++ b/ext/mbstring/tests/bug40685.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #40685 (mb_decode_numericentity() removes '&' in the string)
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+$map = array(0, 0x10FFFF, 0, 0xFFFFFF);
+var_dump(mb_decode_numericentity('&', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('&&&', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('&#', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('&#61', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('&#61;', $map, 'UTF-8'));
+?>
+--EXPECTF--
+string(1) "&"
+string(3) "&&&"
+string(2) "&#"
+string(4) "&#61"
+string(1) "="
+