From 01e2dc44e192b40ff8dd77d1ed639c38b297dd50 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 12 Aug 2010 09:28:30 +0000 Subject: [PATCH] Followup r70930: drop wfLoadExtensionMessages(), use makeTitleSafe() instead of newFromText() per r70390 CR --- TitleBlacklist.hooks.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php index 25d402ae..e14fb668 100644 --- a/TitleBlacklist.hooks.php +++ b/TitleBlacklist.hooks.php @@ -19,7 +19,6 @@ class TitleBlacklistHooks { efInitTitleBlacklist(); $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action ); if( $blacklisted instanceof TitleBlacklistEntry ) { - wfLoadExtensionMessages( 'TitleBlacklist' ); $message = $blacklisted->getCustomMessage(); if( is_null( $message ) ) $message = 'titleblacklist-forbidden-edit'; @@ -40,7 +39,6 @@ class TitleBlacklistHooks { if( !$blacklisted ) $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' ); if( $blacklisted instanceof TitleBlacklistEntry ) { - wfLoadExtensionMessages( 'TitleBlacklist' ); $message = $blacklisted->getCustomMessage(); if( is_null( $message ) ) $message = 'titleblacklist-forbidden-move'; @@ -64,12 +62,11 @@ class TitleBlacklistHooks { private static function acceptNewUserName( $userName, &$err ) { global $wgTitleBlacklist; efInitTitleBlacklist(); - $title = Title::newFromText( $userName, NS_USER ); + $title = Title::makeTitleSafe( NS_USER, $userName ); $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'new-account' ); if( !( $blacklisted instanceof TitleBlacklistEntry ) ) $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'create' ); if( $blacklisted instanceof TitleBlacklistEntry ) { - wfLoadExtensionMessages( 'TitleBlacklist' ); $message = $blacklisted->getCustomMessage(); if ( is_null( $message ) ) $message = 'titleblacklist-forbidden-new-account'; @@ -106,7 +103,6 @@ class TitleBlacklistHooks { return true; } - wfLoadExtensionMessages( 'TitleBlacklist' ); $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); $errlines = '* ' . implode( "\n* ", array_map( 'wfEscapeWikiText', $ok ) ) . ''; $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) . @@ -124,7 +120,6 @@ class TitleBlacklistHooks { if( $retitle !== null && !$retitle->exists() ) { $blacklisted = $wgTitleBlacklist->isBlacklisted( $retitle, 'create' ); if( $blacklisted instanceof TitleBlacklistEntry ) { - wfLoadExtensionMessages( 'TitleBlacklist' ); $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) . wfMsg( 'titleblacklist-forbidden-edit', htmlspecialchars( $blacklisted->getRaw() ),