(bug 36495) Sanitizer: Convert align to margin/float outside tables.
[lhc/web/wiklou.git] / includes / Sanitizer.php
index 8cd5a37..fed5762 100644 (file)
@@ -692,6 +692,16 @@ class Sanitizer {
                                }
                        }
 
+                       if ( $attribute === 'align' && !in_array( $element, $cells ) ) {
+                               if ( $value === 'center' ) {
+                                       $style .= ' margin-left: auto;';
+                                       $property = 'margin-right';
+                                       $value = 'auto';
+                               } else {
+                                       $property = 'float';
+                               }
+                       }
+
                        $style .= " $property: $value;";
 
                        unset( $attribs[$attribute] );