Index: trunk/extensions/UsernameBlacklist/UsernameBlacklist.php |
— | — | @@ -29,12 +29,11 @@ |
30 | 30 | * Register the extension |
31 | 31 | */ |
32 | 32 | function efUsernameBlacklistSetup() { |
33 | | - global $wgHooks, $wgVersion, $wgMessageCache; |
| 33 | + global $wgHooks; |
34 | 34 | require_once( dirname( __FILE__ ) . '/UsernameBlacklist.i18n.php' ); |
35 | 35 | $wgHooks['AbortNewAccount'][] = 'efUsernameBlacklist'; |
36 | 36 | $wgHooks['ArticleSaveComplete'][] = 'efUsernameBlacklistInvalidate'; |
37 | 37 | $wgHooks['EditFilter'][] = 'efUsernameBlacklistValidate'; |
38 | | - wfLoadExtensionMessages('UsernameBlacklist'); |
39 | 38 | } |
40 | 39 | |
41 | 40 | /** |
— | — | @@ -46,6 +45,7 @@ |
47 | 46 | global $wgUser; |
48 | 47 | $blackList =& UsernameBlacklist::fetch(); |
49 | 48 | if( $blackList->match( $user->getName() ) && !$wgUser->isAllowed( 'uboverride' ) ) { |
| 49 | + wfLoadExtensionMessages( 'UsernameBlacklist' ); |
50 | 50 | global $wgOut; |
51 | 51 | $returnTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' ); |
52 | 52 | $wgOut->errorPage( 'blacklistedusername', 'blacklistedusernametext' ); |
— | — | @@ -82,6 +82,7 @@ |
83 | 83 | $badLines = $blacklist->validate( $text ); |
84 | 84 | |
85 | 85 | if( $badLines ) { |
| 86 | + wfLoadExtensionMessages( 'UsernameBlacklist' ); |
86 | 87 | $badList = "*<tt>" . |
87 | 88 | implode( "</tt>\n*<tt>", |
88 | 89 | array_map( 'wfEscapeWikiText', $badLines ) ) . |
— | — | @@ -148,7 +149,7 @@ |
149 | 150 | */ |
150 | 151 | function buildBlacklist() { |
151 | 152 | $blacklist = wfMsgForContent( 'usernameblacklist' ); |
152 | | - if( $blacklist != '<usernameblacklist>' ) { |
| 153 | + if( !wfEmptyMsg( 'usernameblacklist', $blacklist ) ) { |
153 | 154 | return $this->safeBlacklist( $blacklist ); |
154 | 155 | } else { |
155 | 156 | return array(); |