r105302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105301‎ | r105302 | r105303 >
Date:15:25, 6 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove unused $wgInteractiveBlockMessageCacheTimeout

Fix some minor style issues

Remove one redundant else block
Modified paths:
  • /trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessageHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessageHooks.php
@@ -35,19 +35,18 @@
3636 * @return bool
3737 */
3838 public static function parserGetVariable( &$parser, &$varCache, &$index, &$ret ) {
39 - global $wgInteractiveBlockMessageCacheTimeout;
4039 if ( $index != 'USERBLOCKED' ) {
4140 return true;
4241 }
43 -
 42+
4443 if ( $parser->getTitle()->getNamespace() != NS_USER && $parser->getTitle()->getNamespace() != NS_USER_TALK ) {
4544 $ret = 'unknown';
4645 return true;
4746 }
48 -
 47+
4948 $user = User::newFromName( $parser->getTitle()->getBaseText() );
50 - if ($user instanceof User) {
51 - if ($user->isBlocked()) {
 49+ if ( $user instanceof User ) {
 50+ if ( $user->isBlocked() ) {
5251 // if user is blocked it's pretty much possible they will be unblocked one day :)
5352 // so we enable cache for shorter time only so that we can recheck later
5453 // if they weren't already unblocked - if there is a better way to do that, fix me
@@ -56,7 +55,7 @@
5756 $expiry = wfTimestamp( TS_UNIX, $expiry ) - wfTimestamp( TS_UNIX );
5857 if ( $expiry > 0 ) {
5958 // just to make sure
60 - $parser->getOutput()->updateCacheExpiry($expiry);
 59+ $parser->getOutput()->updateCacheExpiry( $expiry );
6160 }
6261 }
6362 $ret = 'true';
@@ -65,11 +64,8 @@
6665 $ret = 'false';
6766 return true;
6867 }
69 - } else {
70 - $ret = 'unknown';
71 - return true;
7268 }
73 - $ret = 'unknown';
 69+ $ret = 'unknown';
7470 return true;
7571 }
7672 }

Status & tagging log