1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 21:28:06 +02:00

[1.7.0] HTML Purifier now works with PHP 4.3.2. Yay!

- Armor some character index checking
- Add compatibility stuff for PHP_EOL
- Add autoclose for colgroup
- Compensate for realpath() quirkiness in old versions
- Add flush maintenance script

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1096 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-05-27 14:27:54 +00:00
parent 21ab12a6a8
commit de23201cbb
10 changed files with 68 additions and 6 deletions

View File

@@ -59,7 +59,7 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends UnitTestCase
'/../../../library/HTMLPurifier/DefinitionCache/Serializer/Test/' .
$config_md5 . '.ser'
);
if($file) unlink($file); // prevent previous failures from causing problems
if($file && file_exists($file)) unlink($file); // prevent previous failures from causing problems
$config = $this->generateConfigMock($config_array);
$this->assertIdentical($config_md5, $cache->generateKey($config));

View File

@@ -57,7 +57,8 @@ class HTMLPurifier_EntityParserTest extends UnitTestCase
// this is only for PHP 5, the below is PHP 5 and PHP 4
//$chars = str_split($arg[1], 2);
$chars = array();
for ($i = 0; isset($arg[1][$i]); $i += 2) {
// strlen must be called in loop because strings size changes
for ($i = 0; strlen($arg[1]) > $i; $i += 2) {
$chars[] = $arg[1][$i] . $arg[1][$i+1];
}
foreach ($chars as $char) {

View File

@@ -97,6 +97,26 @@ class HTMLPurifier_Test extends UnitTestCase
}
function test_table() {
$this->purifier = new HTMLPurifier();
$this->assertPurification(
'<TABLE>
<COLGROUP>
<COL span=3 width=64 />
<TBODY><TR><TD>1</TD><TD>2</TD><TD>3</TD></TR>
</TBODY>
</TABLE>',
'<table>
<colgroup>
<col span="3" width="64" />
</colgroup><tbody><tr><td>1</td><td>2</td><td>3</td></tr>
</tbody>
</table>'
);
}
}
?>