mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-03-24 06:47:02 +00:00
[1.6.1] Fix fatal error with XHTML 1.1 validation.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1013 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
bd58a7ba77
commit
4e77a1adbd
2
NEWS
2
NEWS
@ -25,6 +25,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
to enable
|
to enable
|
||||||
! CSS property white-space now allows nowrap (supported in all modern
|
! CSS property white-space now allows nowrap (supported in all modern
|
||||||
browsers) but not others (which have spotty browser implementations)
|
browsers) but not others (which have spotty browser implementations)
|
||||||
|
! XHTML 1.1 mode now sort-of works without any fatal errors, and
|
||||||
|
lang is now moved over to xml:lang.
|
||||||
- Possibly fatal bug with __autoload() fixed in module manager
|
- Possibly fatal bug with __autoload() fixed in module manager
|
||||||
- Invert HTMLModuleManager->addModule() processing order to check
|
- Invert HTMLModuleManager->addModule() processing order to check
|
||||||
prefixes first and then the literal module
|
prefixes first and then the literal module
|
||||||
|
@ -183,9 +183,18 @@ class HTMLPurifier_HTMLDefinition
|
|||||||
$this->manager->setup($this->config);
|
$this->manager->setup($this->config);
|
||||||
|
|
||||||
foreach ($this->manager->activeModules as $module) {
|
foreach ($this->manager->activeModules as $module) {
|
||||||
foreach($module->info_tag_transform as $k => $v) $this->info_tag_transform[$k] = $v;
|
foreach($module->info_tag_transform as $k => $v) {
|
||||||
foreach($module->info_attr_transform_pre as $k => $v) $this->info_attr_transform_pre[$k] = $v;
|
if ($v === false) unset($this->info_tag_transform[$k]);
|
||||||
foreach($module->info_attr_transform_post as $k => $v) $this->info_attr_transform_post[$k]= $v;
|
else $this->info_tag_transform[$k] = $v;
|
||||||
|
}
|
||||||
|
foreach($module->info_attr_transform_pre as $k => $v) {
|
||||||
|
if ($v === false) unset($this->info_attr_transform_pre[$k]);
|
||||||
|
else $this->info_attr_transform_pre[$k] = $v;
|
||||||
|
}
|
||||||
|
foreach($module->info_attr_transform_post as $k => $v) {
|
||||||
|
if ($v === false) unset($this->info_attr_transform_post[$k]);
|
||||||
|
else $this->info_attr_transform_post[$k] = $v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->info = $this->manager->getElements($this->config);
|
$this->info = $this->manager->getElements($this->config);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once 'HTMLPurifier/AttrTransform/Lang.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Proprietary module that transforms XHTML 1.0 deprecated aspects into
|
* Proprietary module that transforms XHTML 1.0 deprecated aspects into
|
||||||
* XHTML 1.1 compliant ones, when possible. For maximum effectiveness,
|
* XHTML 1.1 compliant ones, when possible. For maximum effectiveness,
|
||||||
@ -25,6 +27,10 @@ class HTMLPurifier_HTMLModule_TransformToXHTML11 extends HTMLPurifier_HTMLModule
|
|||||||
'lang' => false // remove it
|
'lang' => false // remove it
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function HTMLPurifier_HTMLModule_TransformToXHTML11() {
|
||||||
|
$this->info_attr_transform_pre['lang'] = new HTMLPurifier_AttrTransform_Lang();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -231,6 +231,12 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
|
|||||||
'<td style="white-space:nowrap;" />'
|
'<td style="white-space:nowrap;" />'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// test only one lang
|
||||||
|
$this->assertResult(
|
||||||
|
'<b lang="en">asdf</b>',
|
||||||
|
'<b xml:lang="en">asdf</b>', array('HTML.Doctype' => 'XHTML 1.1')
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user