Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -12,11 +12,11 @@ |
13 | 13 | |
14 | 14 | class TitleBlacklistHooks { |
15 | 15 | public static function userCan( $title, $user, $action, &$result ) { |
16 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
17 | 16 | global $wgTitleBlacklist; |
18 | 17 | if( $action == 'create' || $action == 'edit' ) { |
19 | 18 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action ); |
20 | 19 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
| 20 | + wfLoadExtensionMessages( 'TitleBlacklist' ); |
21 | 21 | $message = $blacklisted->getCustomMessage(); |
22 | 22 | if( is_null( $message ) ) |
23 | 23 | $message = 'titleblacklist-forbidden-edit'; |
— | — | @@ -30,12 +30,12 @@ |
31 | 31 | } |
32 | 32 | |
33 | 33 | public static function abortMove( $old, $nt, $user, &$err ) { |
34 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
35 | 34 | global $wgTitleBlacklist; |
36 | 35 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $nt, 'move' ); |
37 | 36 | if( !$blacklisted ) |
38 | 37 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' ); |
39 | 38 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
| 39 | + wfLoadExtensionMessages( 'TitleBlacklist' ); |
40 | 40 | $message = $blacklisted->getCustomMessage(); |
41 | 41 | if( is_null( $message ) ) |
42 | 42 | $message = 'titleblacklist-forbidden-move'; |
— | — | @@ -49,10 +49,10 @@ |
50 | 50 | } |
51 | 51 | |
52 | 52 | public static function verifyUpload( $fname, $fpath, &$err ) { |
53 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
54 | 53 | global $wgTitleBlacklist, $wgUser; |
55 | 54 | $blacklisted = $wgTitleBlacklist->isBlacklisted( Title::newFromText( $fname, NS_IMAGE ), 'upload' ); |
56 | 55 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
| 56 | + wfLoadExtensionMessages( 'TitleBlacklist' ); |
57 | 57 | $message = $blacklisted->getCustomMessage(); |
58 | 58 | if( is_null( $message ) ) |
59 | 59 | $message = 'titleblacklist-forbidden-upload'; |
— | — | @@ -68,13 +68,13 @@ |
69 | 69 | if( $title->getNamespace() != NS_MEDIAWIKI || $title->getDBkey() != 'Titleblacklist' ) |
70 | 70 | return true; |
71 | 71 | |
72 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
73 | 72 | $bl = $wgTitleBlacklist->parseBlacklist( $text ); |
74 | 73 | $ok = $wgTitleBlacklist->validate( $bl ); |
75 | 74 | if( count( $ok ) == 0 ) { |
76 | 75 | return true; |
77 | 76 | } |
78 | 77 | |
| 78 | + wfLoadExtensionMessages( 'TitleBlacklist' ); |
79 | 79 | $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); |
80 | 80 | $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>'; |
81 | 81 | $error = '<div class="errorbox">' . |