# Stupid hack
$encValue = preg_replace_callback(
'/((?i)' . wfUrlProtocols() . ')/',
- [ 'Sanitizer', 'armorLinksCallback' ],
+ function ( $matches ) {
+ return str_replace( ':', ':', $matches[1] );
+ },
$encValue );
return $encValue;
}
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,
static function normalizeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
- [ 'Sanitizer', 'normalizeCharReferencesCallback' ],
+ [ self::class, 'normalizeCharReferencesCallback' ],
$text );
}
public static function decodeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
- [ 'Sanitizer', 'decodeCharReferencesCallback' ],
+ [ self::class, 'decodeCharReferencesCallback' ],
$text );
}
global $wgContLang;
$text = preg_replace_callback(
self::CHAR_REFS_REGEX,
- [ 'Sanitizer', 'decodeCharReferencesCallback' ],
+ [ self::class, 'decodeCharReferencesCallback' ],
$text,
-1, //limit
$count