Merge "Reenable testStoredFunctions() in DatabaseTest.php."
[lhc/web/wiklou.git] / includes / Sanitizer.php
index fed5762..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;
@@ -1253,7 +1255,7 @@ class Sanitizer {
         * a. named char refs can only be < > & ", others are
         *   numericized (this way we're well-formed even without a DTD)
         * b. any numeric char refs must be legal chars, not invalid or forbidden
-        * c. use &#x, not &#X
+        * c. use lower cased "&#x", not "&#X"
         * d. fix or reject non-valid attributes
         *
         * @param $text String
@@ -1421,7 +1423,7 @@ class Sanitizer {
        /**
         * If the named entity is defined in the HTML 4.0/XHTML 1.0 DTD,
         * return the UTF-8 encoding of that character. Otherwise, returns
-        * pseudo-entity source (eg &foo;)
+        * pseudo-entity source (eg "&foo;")
         *
         * @param $name String
         * @return String