Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php |
— | — | @@ -57,7 +57,9 @@ |
58 | 58 | */ |
59 | 59 | function efInitTitleBlacklist() { |
60 | 60 | global $wgTitleBlacklist; |
61 | | - if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) return; |
| 61 | + if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) { |
| 62 | + return; |
| 63 | + } |
62 | 64 | $wgTitleBlacklist = new TitleBlacklist(); |
63 | 65 | } |
64 | 66 | |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -86,7 +86,11 @@ |
87 | 87 | return true; |
88 | 88 | } |
89 | 89 | |
90 | | - /** AbortNewAccount hook */ |
| 90 | + /** AbortNewAccount hook |
| 91 | + * |
| 92 | + * |
| 93 | + * @param User $user |
| 94 | + */ |
91 | 95 | public static function abortNewAccount( $user, &$message ) { |
92 | 96 | global $wgUser, $wgRequest; |
93 | 97 | $override = $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' ); |
— | — | @@ -99,11 +103,15 @@ |
100 | 104 | return self::acceptNewUserName( $userName, $message ); |
101 | 105 | } |
102 | 106 | |
103 | | - /** EditFilter hook */ |
| 107 | + /** EditFilter hook |
| 108 | + * |
| 109 | + * @param EditPage $editor |
| 110 | + */ |
104 | 111 | public static function validateBlacklist( $editor, $text, $section, $error ) { |
105 | 112 | global $wgTitleBlacklist, $wgUser; |
106 | 113 | efInitTitleBlacklist(); |
107 | 114 | $title = $editor->mTitle; |
| 115 | + |
108 | 116 | if( $title->getNamespace() == NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) { |
109 | 117 | |
110 | 118 | $bl = $wgTitleBlacklist->parseBlacklist( $text ); |
— | — | @@ -143,7 +151,10 @@ |
144 | 152 | return true; |
145 | 153 | } |
146 | 154 | |
147 | | - /** ArticleSaveComplete hook */ |
| 155 | + /** ArticleSaveComplete hook |
| 156 | + * |
| 157 | + * @param Article $article |
| 158 | + */ |
148 | 159 | public static function clearBlacklist( &$article, &$user, |
149 | 160 | $text, $summary, $isminor, $iswatch, $section ) |
150 | 161 | { |
— | — | @@ -158,12 +169,13 @@ |
159 | 170 | |
160 | 171 | /** UserCreateForm hook based on the one from AntiSpoof extension */ |
161 | 172 | public static function addOverrideCheckbox( &$template ) { |
162 | | - global $wgRequest, $wgUser; |
| 173 | + global $wgRequest; |
163 | 174 | |
164 | | - if ( TitleBlacklist::userCanOverride( 'new-account' ) ) |
| 175 | + if ( TitleBlacklist::userCanOverride( 'new-account' ) ) { |
165 | 176 | $template->addInputItem( 'wpIgnoreTitleBlacklist', |
166 | 177 | $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' ), |
167 | 178 | 'checkbox', 'titleblacklist-override' ); |
| 179 | + } |
168 | 180 | return true; |
169 | 181 | } |
170 | 182 | } |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -180,7 +180,6 @@ |
181 | 181 | * @return TRUE if whitelisted; otherwise FALSE |
182 | 182 | */ |
183 | 183 | public function isWhitelisted( $title, $action = 'edit' ) { |
184 | | - global $wgUser; |
185 | 184 | if( !($title instanceof Title) ) { |
186 | 185 | $title = Title::newFromText( $title ); |
187 | 186 | } |