summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2011-09-24 02:20:38 +0000
committerRui Hirokawa <hirokawa@php.net>2011-09-24 02:20:38 +0000
commit3d888412da036e1b27cc504e6544cda227bb766a (patch)
treebed3fd7aa97fad1f23f7155c61cbccdc9387c295 /ext/mbstring/tests
parentd296cea9f1588ebd3bbbac862172f20bad65e535 (diff)
downloadphp-git-3d888412da036e1b27cc504e6544cda227bb766a.tar.gz
MFH: fixed #40685: removed '&' in mb_decode_numericentity().
Diffstat (limited to 'ext/mbstring/tests')
-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 0000000000..420b916bc5
--- /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) "="
+