r101471 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101470‎ | r101471 | r101472 >
Date:13:17, 1 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
fixed the purge
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -133,23 +133,23 @@
134134 *
135135 */
136136 public static function purge( $user_type ) {
137 - if ( is_a( $user_type, User ) ) {
138 - $old_user = $user;
 137+ if ( $user_type instanceof User ) {
 138+ $old_user = $user_type;
139139 } else if ( is_string( $user_type ) ){
140 - $old_user = User::newFromName( $userName );
 140+ $old_user = User::newFromName( $user_type );
141141 } else {
142142 return false;
143143 }
144144
145145 // check if something weird didn't happen
146146 if ( $old_user === false || $old_user == null ) {
147 - return true;
 147+ return false;
148148 }
149149 if ( $old_user->getOption('OnlineStatusBar_active') ) {
150150 if ( $old_user->getOption('OnlineStatusBar_autoupdate') == true ) {
151 - $update = SquidUpdate::newSimplePurge( $user->getTalkPage() );
 151+ $update = SquidUpdate::newSimplePurge( $old_user->getTalkPage() );
152152 $update->doUpdate();
153 - $update = SquidUpdate::newSimplePurge( $user->getUserPage() );
 153+ $update = SquidUpdate::newSimplePurge( $old_user->getUserPage() );
154154 $update->doUpdate();
155155 }
156156 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r101475there is no need to hold the class data in variablepetrb14:04, 1 November 2011

Status & tagging log