r84207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84206‎ | r84207 | r84208 >
Date:22:20, 17 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Documentation, braces, unused globals
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.list.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php
@@ -57,7 +57,9 @@
5858 */
5959 function efInitTitleBlacklist() {
6060 global $wgTitleBlacklist;
61 - if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) return;
 61+ if( isset( $wgTitleBlacklist ) && $wgTitleBlacklist ) {
 62+ return;
 63+ }
6264 $wgTitleBlacklist = new TitleBlacklist();
6365 }
6466
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -86,7 +86,11 @@
8787 return true;
8888 }
8989
90 - /** AbortNewAccount hook */
 90+ /** AbortNewAccount hook
 91+ *
 92+ *
 93+ * @param User $user
 94+ */
9195 public static function abortNewAccount( $user, &$message ) {
9296 global $wgUser, $wgRequest;
9397 $override = $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' );
@@ -99,11 +103,15 @@
100104 return self::acceptNewUserName( $userName, $message );
101105 }
102106
103 - /** EditFilter hook */
 107+ /** EditFilter hook
 108+ *
 109+ * @param EditPage $editor
 110+ */
104111 public static function validateBlacklist( $editor, $text, $section, $error ) {
105112 global $wgTitleBlacklist, $wgUser;
106113 efInitTitleBlacklist();
107114 $title = $editor->mTitle;
 115+
108116 if( $title->getNamespace() == NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) {
109117
110118 $bl = $wgTitleBlacklist->parseBlacklist( $text );
@@ -143,7 +151,10 @@
144152 return true;
145153 }
146154
147 - /** ArticleSaveComplete hook */
 155+ /** ArticleSaveComplete hook
 156+ *
 157+ * @param Article $article
 158+ */
148159 public static function clearBlacklist( &$article, &$user,
149160 $text, $summary, $isminor, $iswatch, $section )
150161 {
@@ -158,12 +169,13 @@
159170
160171 /** UserCreateForm hook based on the one from AntiSpoof extension */
161172 public static function addOverrideCheckbox( &$template ) {
162 - global $wgRequest, $wgUser;
 173+ global $wgRequest;
163174
164 - if ( TitleBlacklist::userCanOverride( 'new-account' ) )
 175+ if ( TitleBlacklist::userCanOverride( 'new-account' ) ) {
165176 $template->addInputItem( 'wpIgnoreTitleBlacklist',
166177 $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' ),
167178 'checkbox', 'titleblacklist-override' );
 179+ }
168180 return true;
169181 }
170182 }
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php
@@ -180,7 +180,6 @@
181181 * @return TRUE if whitelisted; otherwise FALSE
182182 */
183183 public function isWhitelisted( $title, $action = 'edit' ) {
184 - global $wgUser;
185184 if( !($title instanceof Title) ) {
186185 $title = Title::newFromText( $title );
187186 }

Status & tagging log