mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
Check if element without attribute is allowed
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
c97bb93223
commit
70c39dd289
@ -243,6 +243,10 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
|
||||
if ($y === '*' || isset($html_definition->info[$y = strtolower($y)])) {
|
||||
$nx = $y;
|
||||
} else {
|
||||
$components2 = explode('[', $y);
|
||||
if (count($components2) === 2 && isset($html_definition->info[$y2 = strtolower($components2[0])])) {
|
||||
$nx = $y2;
|
||||
}
|
||||
// $nx stays null; this matters
|
||||
// if we don't manage to find
|
||||
// any valid selector content,
|
||||
|
@ -262,6 +262,19 @@ text-align:center
|
||||
$this->assertExtractStyleBlocks("<style></style>" . $goo, $goo, array(''));
|
||||
}
|
||||
|
||||
public function test_cleanCSS_elementWithAttribute()
|
||||
{
|
||||
$this->assertCleanCSS(
|
||||
"* img[tabindex=\"0\"] + div {\ntext-align:center\n}",
|
||||
"* img + div {\ntext-align:center\n}"
|
||||
);
|
||||
}
|
||||
|
||||
public function test_cleanCSS_descendantSelector()
|
||||
{
|
||||
$this->assertCleanCSS("* img + div {\ntext-align:center\n}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
Loading…
Reference in New Issue
Block a user