From: Jens Frank Date: Mon, 31 Jan 2005 16:51:41 +0000 (+0000) Subject: BUG#1441 Cleanup PageHistory.php watchlist lookup X-Git-Tag: 1.5.0alpha1~797 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=151701a2a92ee8ffc39f7f7ac1f2b13651ca44e5;p=lhc%2Fweb%2Fwiklou.git BUG#1441 Cleanup PageHistory.php watchlist lookup Patch provided by zigger --- diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 405f41bd28..cc0fdf4e80 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -55,16 +55,13 @@ class PageHistory { $title = $this->mTitle->getText(); $uid = $wgUser->getID(); $db =& wfGetDB( DB_SLAVE ); - if ($wgShowUpdatedMarker && $wgUser->getOption( 'showupdated' )) { - $dbr =& wfGetDB( DB_MASTER ); - $row = $dbr->selectRow( 'watchlist', - array( 'wl_notificationtimestamp' ), - array( 'wl_namespace' => $namespace, 'wl_title' => $this->mTitle->getDBkey(), 'wl_user' => $wgUser->getID() ), + if ($uid && $wgShowUpdatedMarker && $wgUser->getOption( 'showupdated' )) + $notificationtimestamp = $db->selectField( 'watchlist', + 'wl_notificationtimestamp', + array( 'wl_namespace' => $namespace, 'wl_title' => $this->mTitle->getDBkey(), 'wl_user' => $uid ), $fname ); - $notificationtimestamp = $row->wl_notificationtimestamp; - } else $notificationtimestamp = false ; + else $notificationtimestamp = false; - $db =& wfGetDB( DB_SLAVE ); $use_index = $db->useIndexClause( 'page_timestamp' ); $revision = $db->tableName( 'revision' );