From 151701a2a92ee8ffc39f7f7ac1f2b13651ca44e5 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Mon, 31 Jan 2005 16:51:41 +0000 Subject: [PATCH] BUG#1441 Cleanup PageHistory.php watchlist lookup Patch provided by zigger --- includes/PageHistory.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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' ); -- 2.20.1