File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
strings /
htmlentities18.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, 9 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--
htmlentities() / htmlspecialchars() "don't double encode" flag support
--FILE--
<?php
$tests = array(
"abc",
"abc&sfdsa",
"test+s & some more D",
"test+s & some more D",
"&; & &#a; &9; &#xyz;",
"&kffjadfdhsjfhjasdhffasdfas;",
"�",
"&",
"&&&",
"&ab&&",
);
foreach ($tests as $test) {
var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE));
var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE));
}
?>
--EXPECT--
string(3) "abc"
string(3) "abc"
string(13) "abc&sfdsa"
string(13) "abc&sfdsa"
string(33) "test+s & some more D"
string(33) "test+s & some more D"
string(34) "test+s & some more D"
string(34) "test+s & some more D"
string(43) "&; &amp &#a; &9; &#xyz;"
string(43) "&; &amp &#a; &9; &#xyz;"
string(32) "&kffjadfdhsjfhjasdhffasdfas;"
string(32) "&kffjadfdhsjfhjasdhffasdfas;"
string(16) "&#8787978789"
string(16) "&#8787978789"
string(5) "&"
string(5) "&"
string(15) "&&&"
string(15) "&&&"
string(17) "&ab&&"
string(17) "&ab&&"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>