Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function handleElement(&$token)

if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') {
// Mark closing span tag for deletion
$this->markForDeletion->attach($current);
$this->markForDeletion->offsetSet($current);
// Delete open span tag
$token = false;
}
Expand All @@ -85,8 +85,8 @@ public function handleElement(&$token)
*/
public function handleEnd(&$token)
{
if ($this->markForDeletion->contains($token)) {
$this->markForDeletion->detach($token);
if ($this->markForDeletion->offsetExists($token)) {
$this->markForDeletion->offsetUnset($token);
$token = false;
}
}
Expand Down
4 changes: 4 additions & 0 deletions library/HTMLPurifier/URISchemeRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public function getScheme($scheme, $config, $context)
$config = HTMLPurifier_Config::createDefault();
}

if ($scheme === null) {
return;
}

// important, otherwise attacker could include arbitrary file
$allowed_schemes = $config->get('URI.AllowedSchemes');
if (!$config->get('URI.OverrideAllowedSchemes') &&
Expand Down
Loading