Skip to content
Snippets Groups Projects
Commit ed2b2c68 authored by Jared Hancock's avatar Jared Hancock
Browse files

html: Trim space around `;` in @style attributes

parent 1f625787
No related branches found
No related tags found
No related merge requests found
...@@ -167,7 +167,7 @@ class Format { ...@@ -167,7 +167,7 @@ class Format {
if (isset($attributes['class'])) { if (isset($attributes['class'])) {
$classes = explode(' ', $attributes['class']); $classes = explode(' ', $attributes['class']);
foreach ($classes as $i=>$a) foreach ($classes as $i=>$a)
// Unset all unsupported style classes -- anything by M$ // Unset all unsupported style classes -- anything but M$
if (strpos($a, 'Mso') !== 0) if (strpos($a, 'Mso') !== 0)
unset($classes[$i]); unset($classes[$i]);
if ($classes) if ($classes)
...@@ -177,7 +177,7 @@ class Format { ...@@ -177,7 +177,7 @@ class Format {
} }
// Clean browser-specific style attributes // Clean browser-specific style attributes
if (isset($attributes['style'])) { if (isset($attributes['style'])) {
$styles = explode(';', html_entity_decode($attributes['style'])); $styles = preg_split('/;\s*/S', html_entity_decode($attributes['style']));
foreach ($styles as $i=>&$s) { foreach ($styles as $i=>&$s) {
@list($prop, $val) = explode(':', $s); @list($prop, $val) = explode(':', $s);
if (!$val || !$prop || $prop[0] == '-' || substr($prop, 0, 4) == 'mso-') if (!$val || !$prop || $prop[0] == '-' || substr($prop, 0, 4) == 'mso-')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment