Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -37,34 +37,35 @@ |
38 | 38 | return Html::element( 'img', array( 'src' => $icon ) ); |
39 | 39 | } |
40 | 40 | |
| 41 | + |
41 | 42 | /** |
42 | | - * Returns the status and User element |
43 | | - * |
44 | | - * @param Title $title |
45 | | - * @return array|bool Array containing the status and User object |
| 43 | + * Returns the status and User element |
| 44 | + * |
| 45 | + * @param Title $title |
| 46 | + * @return array|bool Array containing the status and User object |
46 | 47 | */ |
47 | | - public static function getAnonFromTitle( Title $title ) { |
| 48 | + public static function getAnonFromTitle( Title $title ) { |
48 | 49 | global $wgOnlineStatusBarTrackIpUsers; |
49 | 50 | if ( $wgOnlineStatusBarTrackIpUsers == false ) { |
50 | 51 | return false; |
51 | 52 | } |
52 | 53 | |
53 | | - if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) { |
54 | | - return false; |
55 | | - } |
| 54 | + if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) { |
| 55 | + return false; |
| 56 | + } |
56 | 57 | |
57 | | - $user = User::newFromId( 0 ); |
| 58 | + $user = User::newFromId( 0 ); |
58 | 59 | $user->setName( $title->getBaseText() ); |
59 | 60 | |
60 | | - // Check if something wrong didn't happen |
61 | | - if ( $user === false ) { |
62 | | - return false; |
63 | | - } |
| 61 | + // Check if something wrong didn't happen |
| 62 | + if ( $user === false ) { |
| 63 | + return false; |
| 64 | + } |
64 | 65 | |
65 | | - $status = self::getStatus( $user ); |
| 66 | + $status = self::getStatus( $user ); |
66 | 67 | |
67 | | - return array( $status, $user ); |
68 | | - } |
| 68 | + return array( $status, $user ); |
| 69 | + } |
69 | 70 | |
70 | 71 | |
71 | 72 | /** |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php |
— | — | @@ -152,11 +152,11 @@ |
153 | 153 | } |
154 | 154 | |
155 | 155 | $result = OnlineStatusBar::getUserInfoFromTitle( $parser->getTitle() ); |
156 | | - |
157 | | - if ( User::isIP( $parser->getTitle()->getBaseText() ) && $result === null ) { |
| 156 | + if ( User::isIP( $parser->getTitle()->getBaseText() ) && $result == null ) { |
158 | 157 | $result = OnlineStatusBar::getAnonFromTitle( $parser->getTitle() ); |
159 | 158 | } |
160 | | - if ( $result === null ) { |
| 159 | + |
| 160 | + if ( $result == null ) { |
161 | 161 | $ret = "unknown"; |
162 | 162 | return true; |
163 | 163 | } |