\n";
if ($htmlkses == $htmlafter)
{
echo 'OK';
$score++;
}
else
echo 'not OK';
echo "
\n";
} # function onetest
# *** MAIN PROGRAM ***
$max = $score = 0;
# Test #1
echo 'Test #1.. ';
$htmlbefore = 'kses \'kses\' kses "kses" kses \\kses\\';
$htmlafter = $htmlbefore;
onetest($htmlbefore, $htmlafter, $score, $max, array());
# Test #2
echo 'Test #2.. ';
$htmlbefore = 'kses
';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max, array());
# Test #3
echo 'Test #3.. ';
$htmlbefore = 'kses < BR >';
$htmlafter = 'kses
';
onetest($htmlbefore, $htmlafter, $score, $max, array('br' => array()));
# Test #4
echo 'Test #4.. ';
$htmlbefore = 'kses > 5
';
$htmlafter = 'kses > 5
';
onetest($htmlbefore, $htmlafter, $score, $max, array('br' => array()));
# Test #5
echo 'Test #5.. ';
$htmlbefore = 'kses < br';
$htmlafter = 'kses
';
onetest($htmlbefore, $htmlafter, $score, $max, array('br' => array()));
# Test #6
echo 'Test #6.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max, array('br' => array(),
'a' => array()));
# Test #7
echo 'Test #7.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #8
echo 'Test #8.. ';
$htmlbefore = 'kses ';
$htmlafter = $htmlbefore;
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #9
echo 'Test #9.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #10
echo 'Test #10.. ';
$htmlbefore = 'kses ';
$htmlafter = $htmlbefore;
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #11
echo 'Test #11.. ';
$htmlbefore = 'kses ';
$htmlafter = $htmlbefore;
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => array('maxlen' => 6))));
# Test #12
echo 'Test #12.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => array('maxlen' => 6))));
# Test #13
echo 'Test #13.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => array('maxval' => 686))));
# Test #14
echo 'Test #14.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => array('maxlen' => 6))));
# Test #15
echo 'Test #15.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #16
echo 'Test #16.. ';
$htmlbefore = 'kses ';
$htmlafter = 'kses ';
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# Test #17
echo 'Test #17.. ';
$htmlbefore = 'kses kses ';
$htmlafter = $htmlbefore;
onetest($htmlbefore, $htmlafter, $score, $max,
array('a' => array('href' => 1)));
# finished
echo "
Score $score out of $max\n";
if ($score != $max)
echo '
Something is wrong! Please contact '.
''.
'the kses-general mailing list, and tell us what '.
"operating system and PHP version you use.\n";
?>