Merge "Show the revision list immediately on "umerge" log action links"
[lhc/web/wiklou.git] / includes / Sanitizer.php
index b173ae9..ce70047 100644 (file)
@@ -328,6 +328,7 @@ class Sanitizer {
         * Regular expression to match HTML/XML attribute pairs within a tag.
         * Allows some... latitude.
         * Used in Sanitizer::fixTagAttributes and Sanitizer::decodeTagAttributes
+        * @return string
         */
        static function getAttribsRegex() {
                if ( self::$attribsRegex === null ) {
@@ -1096,8 +1097,9 @@ class Sanitizer {
                global $wgExperimentalHtmlIds;
                $options = (array)$options;
 
+               $id = Sanitizer::decodeCharReferences( $id );
+
                if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
-                       $id = Sanitizer::decodeCharReferences( $id );
                        $id = preg_replace( '/[ \t\n\r\f_\'"&#%]+/', '_', $id );
                        $id = trim( $id, '_' );
                        if ( $id === '' ) {
@@ -1114,7 +1116,7 @@ class Sanitizer {
                        '%' => '.'
                );
 
-               $id = urlencode( Sanitizer::decodeCharReferences( strtr( $id, ' ', '_' ) ) );
+               $id = urlencode( strtr( $id, ' ', '_' ) );
                $id = str_replace( array_keys( $replace ), array_values( $replace ), $id );
 
                if ( !preg_match( '/^[a-zA-Z]/', $id )