r70932 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70931‎ | r70932 | r70933 >
Date:09:28, 12 August 2010
Author:catrope
Status:ok
Tags:
Comment:
Followup r70930: drop wfLoadExtensionMessages(), use makeTitleSafe() instead of newFromText() per r70390 CR
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -19,7 +19,6 @@
2020 efInitTitleBlacklist();
2121 $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
2222 if( $blacklisted instanceof TitleBlacklistEntry ) {
23 - wfLoadExtensionMessages( 'TitleBlacklist' );
2423 $message = $blacklisted->getCustomMessage();
2524 if( is_null( $message ) )
2625 $message = 'titleblacklist-forbidden-edit';
@@ -40,7 +39,6 @@
4140 if( !$blacklisted )
4241 $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' );
4342 if( $blacklisted instanceof TitleBlacklistEntry ) {
44 - wfLoadExtensionMessages( 'TitleBlacklist' );
4543 $message = $blacklisted->getCustomMessage();
4644 if( is_null( $message ) )
4745 $message = 'titleblacklist-forbidden-move';
@@ -64,12 +62,11 @@
6563 private static function acceptNewUserName( $userName, &$err ) {
6664 global $wgTitleBlacklist;
6765 efInitTitleBlacklist();
68 - $title = Title::newFromText( $userName, NS_USER );
 66+ $title = Title::makeTitleSafe( NS_USER, $userName );
6967 $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'new-account' );
7068 if( !( $blacklisted instanceof TitleBlacklistEntry ) )
7169 $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'create' );
7270 if( $blacklisted instanceof TitleBlacklistEntry ) {
73 - wfLoadExtensionMessages( 'TitleBlacklist' );
7471 $message = $blacklisted->getCustomMessage();
7572 if ( is_null( $message ) )
7673 $message = 'titleblacklist-forbidden-new-account';
@@ -106,7 +103,6 @@
107104 return true;
108105 }
109106
110 - wfLoadExtensionMessages( 'TitleBlacklist' );
111107 $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) );
112108 $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>';
113109 $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) .
@@ -124,7 +120,6 @@
125121 if( $retitle !== null && !$retitle->exists() ) {
126122 $blacklisted = $wgTitleBlacklist->isBlacklisted( $retitle, 'create' );
127123 if( $blacklisted instanceof TitleBlacklistEntry ) {
128 - wfLoadExtensionMessages( 'TitleBlacklist' );
129124 $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) .
130125 wfMsg( 'titleblacklist-forbidden-edit',
131126 htmlspecialchars( $blacklisted->getRaw() ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70390Moved server location out of ResourceLoader and into load.php. Now whatever m...tparscal17:33, 3 August 2010
r70930TitleBlacklist extension fixes:...mgrabovsky08:38, 12 August 2010

Status & tagging log