bug40685.phpt 752 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #40685 (mb_decode_numericentity() removes '&' in the string)
  3. --EXTENSIONS--
  4. mbstring
  5. --FILE--
  6. <?php
  7. $map = array(0, 0x10FFFF, 0, 0xFFFFFF);
  8. var_dump(mb_decode_numericentity('&', $map, 'UTF-8'));
  9. var_dump(mb_decode_numericentity('&&&', $map, 'UTF-8'));
  10. var_dump(mb_decode_numericentity('&#', $map, 'UTF-8'));
  11. var_dump(mb_decode_numericentity('&#x', $map, 'UTF-8'));
  12. var_dump(mb_decode_numericentity('&#61', $map, 'UTF-8'));
  13. var_dump(mb_decode_numericentity('&#x3d', $map, 'UTF-8'));
  14. var_dump(mb_decode_numericentity('&#61;', $map, 'UTF-8'));
  15. var_dump(mb_decode_numericentity('&#x3d;', $map, 'UTF-8'));
  16. ?>
  17. --EXPECT--
  18. string(1) "&"
  19. string(3) "&&&"
  20. string(2) "&#"
  21. string(3) "&#x"
  22. string(4) "&#61"
  23. string(5) "&#x3D"
  24. string(1) "="
  25. string(1) "="