Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -12,7 +12,17 @@ |
13 | 13 | * @ingroup Extensions |
14 | 14 | */ |
15 | 15 | class TitleBlacklistHooks { |
16 | | - /** getUserPermissionsErrorsExpensive hook */ |
| 16 | + |
| 17 | + /** |
| 18 | + * getUserPermissionsErrorsExpensive hook |
| 19 | + * |
| 20 | + * @static |
| 21 | + * @param Title $title |
| 22 | + * @param User $user |
| 23 | + * @param $action |
| 24 | + * @param $result |
| 25 | + * @return bool |
| 26 | + */ |
17 | 27 | public static function userCan( $title, $user, $action, &$result ) { |
18 | 28 | global $wgTitleBlacklist; |
19 | 29 | if( $action == 'create' || $action == 'edit' || $action == 'upload' ) { |
— | — | @@ -28,13 +38,23 @@ |
29 | 39 | return true; |
30 | 40 | } |
31 | 41 | |
32 | | - /** AbortMove hook */ |
| 42 | + /** |
| 43 | + * AbortMove hook |
| 44 | + * |
| 45 | + * @static |
| 46 | + * @param Title $old |
| 47 | + * @param Title $nt |
| 48 | + * @param User $user |
| 49 | + * @param $err |
| 50 | + * @return bool |
| 51 | + */ |
33 | 52 | public static function abortMove( $old, $nt, $user, &$err ) { |
34 | 53 | global $wgTitleBlacklist; |
35 | 54 | efInitTitleBlacklist(); |
36 | 55 | $blacklisted = $wgTitleBlacklist->userCannot( $nt, $user, 'move' ); |
37 | | - if( !$blacklisted ) |
| 56 | + if( !$blacklisted ) { |
38 | 57 | $blacklisted = $wgTitleBlacklist->userCannot( $old, $user, 'edit' ); |
| 58 | + } |
39 | 59 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
40 | 60 | $err = wfMsgWikiHtml( $blacklisted->getErrorMessage( 'move' ), |
41 | 61 | htmlspecialchars( $blacklisted->getRaw() ), |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -312,8 +312,10 @@ |
313 | 313 | wfSuppressWarnings(); |
314 | 314 | $match = preg_match( "/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ), $title->getFullText() ); |
315 | 315 | wfRestoreWarnings(); |
| 316 | + |
| 317 | + global $wgUser; |
316 | 318 | if( $match ) { |
317 | | - if( isset( $this->mParams['autoconfirmed'] ) && $user->isAllowed( 'autoconfirmed' ) ) { |
| 319 | + if( isset( $this->mParams['autoconfirmed'] ) && $wgUser->isAllowed( 'autoconfirmed' ) ) { |
318 | 320 | return true; |
319 | 321 | } |
320 | 322 | if( isset( $this->mParams['moveonly'] ) && $action != 'move' ) { |