Index: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessageHooks.php |
— | — | @@ -35,19 +35,18 @@ |
36 | 36 | * @return bool |
37 | 37 | */ |
38 | 38 | public static function parserGetVariable( &$parser, &$varCache, &$index, &$ret ) { |
39 | | - global $wgInteractiveBlockMessageCacheTimeout; |
40 | 39 | if ( $index != 'USERBLOCKED' ) { |
41 | 40 | return true; |
42 | 41 | } |
43 | | - |
| 42 | + |
44 | 43 | if ( $parser->getTitle()->getNamespace() != NS_USER && $parser->getTitle()->getNamespace() != NS_USER_TALK ) { |
45 | 44 | $ret = 'unknown'; |
46 | 45 | return true; |
47 | 46 | } |
48 | | - |
| 47 | + |
49 | 48 | $user = User::newFromName( $parser->getTitle()->getBaseText() ); |
50 | | - if ($user instanceof User) { |
51 | | - if ($user->isBlocked()) { |
| 49 | + if ( $user instanceof User ) { |
| 50 | + if ( $user->isBlocked() ) { |
52 | 51 | // if user is blocked it's pretty much possible they will be unblocked one day :) |
53 | 52 | // so we enable cache for shorter time only so that we can recheck later |
54 | 53 | // if they weren't already unblocked - if there is a better way to do that, fix me |
— | — | @@ -56,7 +55,7 @@ |
57 | 56 | $expiry = wfTimestamp( TS_UNIX, $expiry ) - wfTimestamp( TS_UNIX ); |
58 | 57 | if ( $expiry > 0 ) { |
59 | 58 | // just to make sure |
60 | | - $parser->getOutput()->updateCacheExpiry($expiry); |
| 59 | + $parser->getOutput()->updateCacheExpiry( $expiry ); |
61 | 60 | } |
62 | 61 | } |
63 | 62 | $ret = 'true'; |
— | — | @@ -65,11 +64,8 @@ |
66 | 65 | $ret = 'false'; |
67 | 66 | return true; |
68 | 67 | } |
69 | | - } else { |
70 | | - $ret = 'unknown'; |
71 | | - return true; |
72 | 68 | } |
73 | | - $ret = 'unknown'; |
| 69 | + $ret = 'unknown'; |
74 | 70 | return true; |
75 | 71 | } |
76 | 72 | } |