X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOutput.php;h=10ac1925bdc935c2bb75f04bafeca4a11fe9b2a4;hb=97a8fb78faa4ca2d9604140e5547f5deae5a2524;hp=7bf848fb90929254258ad9b7c2e0cb7bdd78cda3;hpb=524b25dc301baee0b49fd04f355aa78c7040925d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 7bf848fb90..10ac1925bd 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -535,6 +535,10 @@ class ParserOutput extends CacheTime { # We don't register links pointing to our own server, unless... :-) global $wgServer, $wgRegisterInternalExternals; + # Replace unnecessary URL escape codes with the referenced character + # This prevents spammers from hiding links from the filters + $url = parser::normalizeLinkUrl( $url ); + $registerExternalLink = true; if ( !$wgRegisterInternalExternals ) { $registerExternalLink = !self::isLinkInternal( $wgServer, $url ); @@ -696,18 +700,20 @@ class ParserOutput extends CacheTime { * to SpecialTrackingCategories::$coreTrackingCategories, and extensions * should add to "TrackingCategories" in their extension.json. * + * @todo Migrate some code to TrackingCategories + * * @param string $msg Message key * @param Title $title title of the page which is being tracked * @return bool Whether the addition was successful * @since 1.25 */ public function addTrackingCategory( $msg, $title ) { - if ( $title->getNamespace() === NS_SPECIAL ) { + if ( $title->isSpecialPage() ) { wfDebug( __METHOD__ . ": Not adding tracking category $msg to special page!\n" ); return false; } - // Important to parse with correct title (bug 31469) + // Important to parse with correct title (T33469) $cat = wfMessage( $msg ) ->title( $title ) ->inContentLanguage()