r29744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29743‎ | r29744 | r29745 >
Date:14:08, 14 January 2008
Author:vasilievvv
Status:old
Tags:
Comment:
* Delay message loading
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -12,11 +12,11 @@
1313
1414 class TitleBlacklistHooks {
1515 public static function userCan( $title, $user, $action, &$result ) {
16 - wfLoadExtensionMessages( 'TitleBlacklist' );
1716 global $wgTitleBlacklist;
1817 if( $action == 'create' || $action == 'edit' ) {
1918 $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
2019 if( $blacklisted instanceof TitleBlacklistEntry ) {
 20+ wfLoadExtensionMessages( 'TitleBlacklist' );
2121 $message = $blacklisted->getCustomMessage();
2222 if( is_null( $message ) )
2323 $message = 'titleblacklist-forbidden-edit';
@@ -30,12 +30,12 @@
3131 }
3232
3333 public static function abortMove( $old, $nt, $user, &$err ) {
34 - wfLoadExtensionMessages( 'TitleBlacklist' );
3534 global $wgTitleBlacklist;
3635 $blacklisted = $wgTitleBlacklist->isBlacklisted( $nt, 'move' );
3736 if( !$blacklisted )
3837 $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' );
3938 if( $blacklisted instanceof TitleBlacklistEntry ) {
 39+ wfLoadExtensionMessages( 'TitleBlacklist' );
4040 $message = $blacklisted->getCustomMessage();
4141 if( is_null( $message ) )
4242 $message = 'titleblacklist-forbidden-move';
@@ -49,10 +49,10 @@
5050 }
5151
5252 public static function verifyUpload( $fname, $fpath, &$err ) {
53 - wfLoadExtensionMessages( 'TitleBlacklist' );
5453 global $wgTitleBlacklist, $wgUser;
5554 $blacklisted = $wgTitleBlacklist->isBlacklisted( Title::newFromText( $fname, NS_IMAGE ), 'upload' );
5655 if( $blacklisted instanceof TitleBlacklistEntry ) {
 56+ wfLoadExtensionMessages( 'TitleBlacklist' );
5757 $message = $blacklisted->getCustomMessage();
5858 if( is_null( $message ) )
5959 $message = 'titleblacklist-forbidden-upload';
@@ -68,13 +68,13 @@
6969 if( $title->getNamespace() != NS_MEDIAWIKI || $title->getDBkey() != 'Titleblacklist' )
7070 return true;
7171
72 - wfLoadExtensionMessages( 'TitleBlacklist' );
7372 $bl = $wgTitleBlacklist->parseBlacklist( $text );
7473 $ok = $wgTitleBlacklist->validate( $bl );
7574 if( count( $ok ) == 0 ) {
7675 return true;
7776 }
7877
 78+ wfLoadExtensionMessages( 'TitleBlacklist' );
7979 $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) );
8080 $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>';
8181 $error = '<div class="errorbox">' .

Status & tagging log