From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/WatchedItem.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'includes/WatchedItem.php') diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index d1c15296..dd6e247b 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -84,6 +84,8 @@ class WatchedItem { * @return bool */ public function removeWatch() { + wfProfileIn( __METHOD__ ); + $success = false; $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'watchlist', @@ -112,6 +114,8 @@ class WatchedItem { if ( $dbw->affectedRows() ) { $success = true; } + + wfProfileOut( __METHOD__ ); return $success; } @@ -143,14 +147,13 @@ class WatchedItem { ); # Construct array to replace into the watchlist $values = array(); - while ( $s = $dbw->fetchObject( $res ) ) { + foreach ( $res as $s ) { $values[] = array( 'wl_user' => $s->wl_user, 'wl_namespace' => $newnamespace, 'wl_title' => $newtitle ); } - $dbw->freeResult( $res ); if( empty( $values ) ) { // Nothing to do -- cgit v1.2.2