File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
strings /
bug44703.phpt
Revision
1.1.1.2 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:45 2012 UTC (12 years, 2 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
HEAD
php 5.4.3+patches
--TEST--
Bug #44703 (htmlspecialchars() does not detect bad character set argument)
--FILE--
<?php
var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 1));
var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 12));
var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 125));
var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 1252));
var_dump(htmlspecialchars(b"<a href='test'>Test</a>", ENT_COMPAT, 12526));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 866));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 8666));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, NULL));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 'SJIS'));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, 'SjiS'));
var_dump(htmlspecialchars(b"<>", ENT_COMPAT, str_repeat('a', 100)));
?>
--EXPECTF--
Warning: htmlspecialchars(): charset `1' not supported, assuming utf-8 in %s on line %d
string(35) "<a href='test'>Test</a>"
Warning: htmlspecialchars(): charset `12' not supported, assuming utf-8 in %s on line %d
string(35) "<a href='test'>Test</a>"
Warning: htmlspecialchars(): charset `125' not supported, assuming utf-8 in %s on line %d
string(35) "<a href='test'>Test</a>"
string(35) "<a href='test'>Test</a>"
Warning: htmlspecialchars(): charset `12526' not supported, assuming utf-8 in %s on line %d
string(35) "<a href='test'>Test</a>"
string(8) "<>"
Warning: htmlspecialchars(): charset `8666' not supported, assuming utf-8 in %s on line %d
string(8) "<>"
string(8) "<>"
string(8) "<>"
string(8) "<>"
Warning: htmlspecialchars(): charset `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' not supported, assuming utf-8 in %s on line %d
string(8) "<>"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>