mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-08 07:01:53 +00:00
Merged revisions 380:382 from trunk/ to branches/1.0/:
- Disambiguate between iconv and PHP test runs for cleanUTF8. - Fixed rejection of inline style declarations that had lots of extra space in them. This manifested in TinyMCE. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/1.0@383 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
0c4a9c0479
commit
374736ae44
2
NEWS
2
NEWS
@ -5,6 +5,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
- Fixed slight bug in DOMLex attribute parsing
|
- Fixed slight bug in DOMLex attribute parsing
|
||||||
- Fixed rejection of case-insensitive configuration values when there is a
|
- Fixed rejection of case-insensitive configuration values when there is a
|
||||||
set of allowed values. This manifested in %Core.Encoding.
|
set of allowed values. This manifested in %Core.Encoding.
|
||||||
|
- Fixed rejection of inline style declarations that had lots of extra
|
||||||
|
space in them. This manifested in TinyMCE.
|
||||||
|
|
||||||
1.0.0, released 2006-09-01
|
1.0.0, released 2006-09-01
|
||||||
- Fixed broken numeric entity conversion
|
- Fixed broken numeric entity conversion
|
||||||
|
@ -28,6 +28,8 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
|
|||||||
if (!$declaration) continue;
|
if (!$declaration) continue;
|
||||||
if (!strpos($declaration, ':')) continue;
|
if (!strpos($declaration, ':')) continue;
|
||||||
list($property, $value) = explode(':', $declaration, 2);
|
list($property, $value) = explode(':', $declaration, 2);
|
||||||
|
$property = trim($property);
|
||||||
|
$value = trim($value);
|
||||||
if (!isset($definition->info[$property])) continue;
|
if (!isset($definition->info[$property])) continue;
|
||||||
// inefficient call, since the validator will do this again
|
// inefficient call, since the validator will do this again
|
||||||
if (strtolower(trim($value)) !== 'inherit') {
|
if (strtolower(trim($value)) !== 'inherit') {
|
||||||
|
@ -92,6 +92,10 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
|||||||
$this->assertDef('position:absolute;', false);
|
$this->assertDef('position:absolute;', false);
|
||||||
$this->assertDef('background-image:url(javascript:alert\(\));', false);
|
$this->assertDef('background-image:url(javascript:alert\(\));', false);
|
||||||
|
|
||||||
|
// airy input
|
||||||
|
$this->assertDef(' font-weight : bold; color : #ff0000',
|
||||||
|
'font-weight:bold;color:#ff0000;');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@ class HTMLPurifier_EncoderTest extends UnitTestCase
|
|||||||
|
|
||||||
function assertCleanUTF8($string, $expect = null) {
|
function assertCleanUTF8($string, $expect = null) {
|
||||||
if ($expect === null) $expect = $string;
|
if ($expect === null) $expect = $string;
|
||||||
$this->assertIdentical($this->Encoder->cleanUTF8($string), $expect);
|
$this->assertIdentical($this->Encoder->cleanUTF8($string), $expect, 'iconv: %s');
|
||||||
$this->assertIdentical($this->Encoder->cleanUTF8($string, true), $expect);
|
$this->assertIdentical($this->Encoder->cleanUTF8($string, true), $expect, 'PHP: %s');
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_cleanUTF8() {
|
function test_cleanUTF8() {
|
||||||
|
@ -8,7 +8,8 @@ class HTMLPurifier_Test extends UnitTestCase
|
|||||||
{
|
{
|
||||||
var $purifier;
|
var $purifier;
|
||||||
|
|
||||||
function assertPurification($input, $expect) {
|
function assertPurification($input, $expect = null) {
|
||||||
|
if ($expect === null) $expect = $input;
|
||||||
$result = $this->purifier->purify($input);
|
$result = $this->purifier->purify($input);
|
||||||
$this->assertIdentical($expect, $result);
|
$this->assertIdentical($expect, $result);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user