# 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 );
* 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()