File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
strings /
html_entity_decode1.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:45 2012 UTC (12 years, 1 month 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--
html_entity_decode: Decoding of entities after invalid entities
--FILE--
<?php
$arr = array(
"&",
"&&",
"&$",
"&#&",
"&#$",
"&#x&",
"&#x$",
"&",
"$",
" &",
" $",
"&",
"$",
"&",
"$",
"&a&",
"&a$",
"&aa&",
"&aa$",
"&aa;&",
"&aa;$",
"&;&",
"&;$",
);
$i = 0;
foreach ($arr as $ent) {
if ($i % 2 == 1) {
if (($a = html_entity_decode($ent, ENT_QUOTES, 'UTF-8')) !=
($b = htmlspecialchars_decode($ent, ENT_QUOTES))) {
echo "htmlspecialchars_decode <-> html_entity_decode inconsistency","\n",
"$b <-> $a","\n";
}
}
echo html_entity_decode($ent, ENT_QUOTES, 'UTF-8'), "\n";
}
echo "Done.\n";
--EXPECT--
&
&&
&$
&#&
&#$
&#x&
&#x$
&
$
 &
 $
&
$
&
$
&a&
&a$
&aa&
&aa$
&aa;&
&aa;$
&;&
&;$
Done.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>