r29566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29565‎ | r29566 | r29567 >
Date:23:16, 10 January 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Delay message loading
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php
@@ -36,7 +36,6 @@
3737 function efInitTitleBlacklist() {
3838 global $wgTitleBlacklist;
3939 $wgTitleBlacklist = new TitleBlacklist();
40 - wfLoadExtensionMessages( 'TitleBlacklist' );
4140 efSetupTitleBlacklistHooks();
4241 }
4342
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -12,6 +12,7 @@
1313
1414 class TitleBlacklistHooks {
1515 public static function userCan( $title, $user, $action, &$result ) {
 16+ wfLoadExtensionMessages( 'TitleBlacklist' );
1617 global $wgTitleBlacklist;
1718 if( $action == 'create' || $action == 'edit' ) {
1819 $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
@@ -29,6 +30,7 @@
3031 }
3132
3233 public static function abortMove( $old, $nt, $user, &$err ) {
 34+ wfLoadExtensionMessages( 'TitleBlacklist' );
3335 global $wgTitleBlacklist;
3436 $blacklisted = $wgTitleBlacklist->isBlacklisted( $nt, 'move' );
3537 if( !$blacklisted )
@@ -47,6 +49,7 @@
4850 }
4951
5052 public static function verifyUpload( $fname, $fpath, &$err ) {
 53+ wfLoadExtensionMessages( 'TitleBlacklist' );
5154 global $wgTitleBlacklist, $wgUser;
5255 $blacklisted = $wgTitleBlacklist->isBlacklisted( Title::newFromText( $fname, NS_IMAGE ), 'upload' );
5356 if( $blacklisted instanceof TitleBlacklistEntry ) {
@@ -65,6 +68,7 @@
6669 if( $title->getNamespace() != NS_MEDIAWIKI || $title->getDbKey() != 'Titleblacklist' )
6770 return true;
6871
 72+ wfLoadExtensionMessages( 'TitleBlacklist' );
6973 $bl = $wgTitleBlacklist->parseBlacklist( $text );
7074 $ok = $wgTitleBlacklist->validate( $bl );
7175 if( count( $ok ) == 0 ) {

Status & tagging log