Annotation of embedaddon/php/ext/standard/tests/strings/bug44703.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #44703 (htmlspecialchars() does not detect bad character set argument)
! 3: --FILE--
! 4: <?php
! 5:
! 6: var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 1));
! 7: var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 12));
! 8: var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 125));
! 9: var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 1252));
! 10: var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 12526));
! 11:
! 12: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 866));
! 13: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 8666));
! 14:
! 15: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, NULL));
! 16:
! 17:
! 18: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 'SJIS'));
! 19: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 'SjiS'));
! 20:
! 21: var_dump(htmlspecialchars(b"<>", ENT_COMPAT, str_repeat('a', 100)));
! 22:
! 23: ?>
! 24: --EXPECTF--
! 25: Warning: htmlspecialchars(): charset `1' not supported, assuming iso-8859-1 in %s on line %d
! 26: string(35) "<a href='test'>Test</a>"
! 27:
! 28: Warning: htmlspecialchars(): charset `12' not supported, assuming iso-8859-1 in %s on line %d
! 29: string(35) "<a href='test'>Test</a>"
! 30:
! 31: Warning: htmlspecialchars(): charset `125' not supported, assuming iso-8859-1 in %s on line %d
! 32: string(35) "<a href='test'>Test</a>"
! 33: string(35) "<a href='test'>Test</a>"
! 34:
! 35: Warning: htmlspecialchars(): charset `12526' not supported, assuming iso-8859-1 in %s on line %d
! 36: string(35) "<a href='test'>Test</a>"
! 37: string(8) "<>"
! 38:
! 39: Warning: htmlspecialchars(): charset `8666' not supported, assuming iso-8859-1 in %s on line %d
! 40: string(8) "<>"
! 41: string(8) "<>"
! 42: string(8) "<>"
! 43: string(8) "<>"
! 44:
! 45: Warning: htmlspecialchars(): charset `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' not supported, assuming iso-8859-1 in %s on line %d
! 46: string(8) "<>"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>