Merge "Remove unused code from LegacyHookPreAuthenticationProvider"
[lhc/web/wiklou.git] / includes / parser / Sanitizer.php
index b570a43..de7a6fa 100644 (file)
@@ -1171,7 +1171,9 @@ class Sanitizer {
                # Stupid hack
                $encValue = preg_replace_callback(
                        '/((?i)' . wfUrlProtocols() . ')/',
-                       [ 'Sanitizer', 'armorLinksCallback' ],
+                       function ( $matches ) {
+                               return str_replace( ':', ':', $matches[1] );
+                       },
                        $encValue );
                return $encValue;
        }
@@ -1416,15 +1418,6 @@ class Sanitizer {
                return $html;
        }
 
-       /**
-        * Regex replace callback for armoring links against further processing.
-        * @param array $matches
-        * @return string
-        */
-       private static function armorLinksCallback( $matches ) {
-               return str_replace( ':', ':', $matches[1] );
-       }
-
        /**
         * Return an associative array of attribute names and values from
         * a partial tag string. Attribute names are forced to lowercase,
@@ -1549,7 +1542,7 @@ class Sanitizer {
        static function normalizeCharReferences( $text ) {
                return preg_replace_callback(
                        self::CHAR_REFS_REGEX,
-                       [ 'Sanitizer', 'normalizeCharReferencesCallback' ],
+                       [ self::class, 'normalizeCharReferencesCallback' ],
                        $text );
        }
 
@@ -1649,7 +1642,7 @@ class Sanitizer {
        public static function decodeCharReferences( $text ) {
                return preg_replace_callback(
                        self::CHAR_REFS_REGEX,
-                       [ 'Sanitizer', 'decodeCharReferencesCallback' ],
+                       [ self::class, 'decodeCharReferencesCallback' ],
                        $text );
        }
 
@@ -1667,7 +1660,7 @@ class Sanitizer {
                global $wgContLang;
                $text = preg_replace_callback(
                        self::CHAR_REFS_REGEX,
-                       [ 'Sanitizer', 'decodeCharReferencesCallback' ],
+                       [ self::class, 'decodeCharReferencesCallback' ],
                        $text,
                        -1, //limit
                        $count