r91172 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91171‎ | r91172 | r91173 >
Date:14:49, 30 June 2011
Author:ialex
Status:ok
Tags:
Comment:
Use the current instance instead of messing with $wgUser
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2520,7 +2520,7 @@
25212521 * @param $title Title of the article to look at
25222522 */
25232523 function clearNotification( &$title ) {
2524 - global $wgUser, $wgUseEnotif, $wgShowUpdatedMarker;
 2524+ global $wgUseEnotif, $wgShowUpdatedMarker;
25252525
25262526 # Do nothing if the database is locked to writes
25272527 if( wfReadOnly() ) {
@@ -2548,13 +2548,11 @@
25492549 // and when it does have to be executed, it can be on a slave
25502550 // If this is the user's newtalk page, we always update the timestamp
25512551 if( $title->getNamespace() == NS_USER_TALK &&
2552 - $title->getText() == $wgUser->getName() )
 2552+ $title->getText() == $this->getName() )
25532553 {
25542554 $watched = true;
2555 - } elseif ( $this->getId() == $wgUser->getId() ) {
2556 - $watched = $title->userIsWatching();
25572555 } else {
2558 - $watched = true;
 2556+ $watched = $this->isWatched( $title );
25592557 }
25602558
25612559 // If the page is watched by the user (or may be watched), update the timestamp on any

Status & tagging log