Merge "Reenable testStoredFunctions() in DatabaseTest.php."
[lhc/web/wiklou.git] / includes / Sanitizer.php
index a0c77da..224b2d1 100644 (file)
@@ -692,7 +692,9 @@ class Sanitizer {
                                }
                        }
 
-                       if ( $attribute === 'align' && !in_array( $element, $cells ) ) {
+                       // Table align is special, it's about block alignment instead of
+                       // content align (see also bug 40306)
+                       if ( $attribute === 'align' && in_array( $element, $table ) ) {
                                if ( $value === 'center' ) {
                                        $style .= ' margin-left: auto;';
                                        $property = 'margin-right';
@@ -1026,7 +1028,7 @@ class Sanitizer {
 
                # Stupid hack
                $encValue = preg_replace_callback(
-                       '/(' . wfUrlProtocols() . ')/',
+                       '/((?i)' . wfUrlProtocols() . ')/',
                        array( 'Sanitizer', 'armorLinksCallback' ),
                        $encValue );
                return $encValue;