Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / includes / Sanitizer.php
index b6b7922..a7f963a 100644 (file)
@@ -1203,8 +1203,6 @@ class Sanitizer {
                global $wgExperimentalHtmlIds;
                $options = (array)$options;
 
-               $id = self::decodeCharReferences( $id );
-
                if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
                        $id = preg_replace( '/[ \t\n\r\f_\'"&#%]+/', '_', $id );
                        $id = trim( $id, '_' );
@@ -1284,7 +1282,6 @@ class Sanitizer {
                $mode = $wgFragmentMode[self::ID_PRIMARY];
 
                $id = self::escapeIdInternal( $id, $mode );
-               $id = self::urlEscapeId( $id, $mode );
 
                return $id;
        }
@@ -1302,23 +1299,6 @@ class Sanitizer {
                global $wgExternalInterwikiFragmentMode;
 
                $id = self::escapeIdInternal( $id, $wgExternalInterwikiFragmentMode );
-               $id = self::urlEscapeId( $id, $wgExternalInterwikiFragmentMode );
-
-               return $id;
-       }
-
-       /**
-        * Helper for escapeIdFor*() functions. URL-escapes the ID if needed.
-        *
-        * @param string $id String to escape
-        * @param string $mode One of modes from $wgFragmentMode
-        * @return string
-        */
-       private static function urlEscapeId( $id, $mode ) {
-               if ( $mode === 'html5' ) {
-                       $id = urlencode( $id );
-                       $id = str_replace( '%3A', ':', $id );
-               }
 
                return $id;
        }
@@ -1331,8 +1311,6 @@ class Sanitizer {
         * @return string
         */
        private static function escapeIdInternal( $id, $mode ) {
-               $id = self::decodeCharReferences( $id );
-
                switch ( $mode ) {
                        case 'html5':
                                $id = str_replace( ' ', '_', $id );
@@ -1677,7 +1655,10 @@ class Sanitizer {
                $text = preg_replace_callback(
                        self::CHAR_REFS_REGEX,
                        [ 'Sanitizer', 'decodeCharReferencesCallback' ],
-                       $text, /* limit */ -1, $count );
+                       $text,
+                       -1, //limit
+                       $count
+               );
 
                if ( $count ) {
                        return $wgContLang->normalize( $text );