Skip to content

Commit

Permalink
MDL-2684: kses strips out CSS from style tags unless the first proper…
Browse files Browse the repository at this point in the history
…ty is on 'allowed' list, this is silly
  • Loading branch information
sammarshallou committed Dec 2, 2009
1 parent 640bb8c commit 6c37c4c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ function kses_hair($attr, $allowed_protocols)
if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match))
# "value"
{
$thisval = kses_bad_protocol($match[1], $allowed_protocols);
// MDL-2684 - kses stripping CSS styles that it thinks look like protocols
if ($attrname == 'style') {
$thisval = $match[1];
} else {
$thisval = kses_bad_protocol($match[1], $allowed_protocols);
}

$attrarr[] = array
('name' => $attrname,
Expand Down

0 comments on commit 6c37c4c

Please sign in to comment.