mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
Improve HTMLFilter handling of editor component properties
This commit is contained in:
parent
24c29cfbdb
commit
aa879e7326
2 changed files with 15 additions and 2 deletions
|
|
@ -516,11 +516,16 @@ class HTMLFilter
|
|||
{
|
||||
return $attr[0];
|
||||
}
|
||||
if (preg_match('/^(?:on|data-|(?:accesskey|class|contextmenu|contenteditable|dir|draggable|dropzone|editor_component|hidden|id|lang|name|style|tabindex|title)$)/', $attrkey))
|
||||
if (preg_match('/^(?:on|data-|(?:accesskey|class|contextmenu|contenteditable|dir|draggable|dropzone|editor_component|hidden|id|lang|name|style|tabindex|title|rx_encoded_properties)$)/i', $attrkey))
|
||||
{
|
||||
return $attr[0];
|
||||
}
|
||||
$attrs[$attrkey] = htmlspecialchars_decode($attr[2]);
|
||||
$attrval = utf8_normalize_spaces(utf8_clean(html_entity_decode($attr[2])));
|
||||
if (preg_match('/^javascript:/i', preg_replace('/\s+/', '', $attrval)))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
$attrs[$attrkey] = $attrval;
|
||||
return '';
|
||||
}, $match[0]);
|
||||
if ($tag === 'img' && !preg_match('/\ssrc="/', $html))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue