X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWatchedItem.php;h=524e701b694f8318b41292d894f7252abf7ad20a;hb=1a4928389f999b76a0be196f8b7586e194f01295;hp=fbd61199f21c381c47844f52631e5645e85ca45e;hpb=7023eb570751cbac0832bf0e7a8d3b4c84f41202;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index fbd61199f2..524e701b69 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -240,11 +240,7 @@ class WatchedItem { } else { // Oldid given and isn't the latest; update the timestamp. // This will result in no further notification emails being sent! - $dbr = wfGetDB( DB_SLAVE ); - $notificationTimestamp = $dbr->selectField( - 'revision', 'rev_timestamp', - array( 'rev_page' => $title->getArticleID(), 'rev_id' => $oldid ) - ); + $notificationTimestamp = Revision::getTimestampFromId( $title, $oldid ); // We need to go one second to the future because of various strict comparisons // throughout the codebase $ts = new MWTimestamp( $notificationTimestamp ); @@ -275,7 +271,6 @@ class WatchedItem { * @return bool */ public static function batchAddWatch( array $items ) { - $section = new ProfileSection( __METHOD__ ); if ( wfReadOnly() ) { return false; @@ -331,11 +326,9 @@ class WatchedItem { * @return bool */ public function removeWatch() { - wfProfileIn( __METHOD__ ); // Only loggedin user can have a watchlist if ( wfReadOnly() || $this->mUser->isAnon() || !$this->isAllowed( 'editmywatchlist' ) ) { - wfProfileOut( __METHOD__ ); return false; } @@ -370,7 +363,6 @@ class WatchedItem { $this->watched = false; - wfProfileOut( __METHOD__ ); return $success; }