r29555 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29554‎ | r29555 | r29556 >
Date:21:06, 10 January 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Delay message loading
Modified paths:
  • /trunk/extensions/UsernameBlacklist/UsernameBlacklist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsernameBlacklist/UsernameBlacklist.php
@@ -29,12 +29,11 @@
3030 * Register the extension
3131 */
3232 function efUsernameBlacklistSetup() {
33 - global $wgHooks, $wgVersion, $wgMessageCache;
 33+ global $wgHooks;
3434 require_once( dirname( __FILE__ ) . '/UsernameBlacklist.i18n.php' );
3535 $wgHooks['AbortNewAccount'][] = 'efUsernameBlacklist';
3636 $wgHooks['ArticleSaveComplete'][] = 'efUsernameBlacklistInvalidate';
3737 $wgHooks['EditFilter'][] = 'efUsernameBlacklistValidate';
38 - wfLoadExtensionMessages('UsernameBlacklist');
3938 }
4039
4140 /**
@@ -46,6 +45,7 @@
4746 global $wgUser;
4847 $blackList =& UsernameBlacklist::fetch();
4948 if( $blackList->match( $user->getName() ) && !$wgUser->isAllowed( 'uboverride' ) ) {
 49+ wfLoadExtensionMessages( 'UsernameBlacklist' );
5050 global $wgOut;
5151 $returnTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
5252 $wgOut->errorPage( 'blacklistedusername', 'blacklistedusernametext' );
@@ -82,6 +82,7 @@
8383 $badLines = $blacklist->validate( $text );
8484
8585 if( $badLines ) {
 86+ wfLoadExtensionMessages( 'UsernameBlacklist' );
8687 $badList = "*<tt>" .
8788 implode( "</tt>\n*<tt>",
8889 array_map( 'wfEscapeWikiText', $badLines ) ) .
@@ -148,7 +149,7 @@
149150 */
150151 function buildBlacklist() {
151152 $blacklist = wfMsgForContent( 'usernameblacklist' );
152 - if( $blacklist != '&lt;usernameblacklist&gt;' ) {
 153+ if( !wfEmptyMsg( 'usernameblacklist', $blacklist ) ) {
153154 return $this->safeBlacklist( $blacklist );
154155 } else {
155156 return array();

Status & tagging log