X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWatchedItem.php;h=031b2b48b03f7c8ded6ca111ea3d2c1eb6122027;hb=65f2772e50d49c08a097b0a0af40d6c7c8bb7e05;hp=1fd6e313823918fa194410f998de066a9f8562bb;hpb=4c74490bb81c891fc450f21899ed462af652e978;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 1fd6e31382..031b2b48b0 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; } @@ -129,6 +133,11 @@ class WatchedItem { /** * Handle duplicate entries. Backend for duplicateEntries(). + * + * @param $ot Title + * @param $nt Title + * + * @return bool */ private static function doDuplicateEntries( $ot, $nt ) { $oldnamespace = $ot->getNamespace(); @@ -143,7 +152,7 @@ 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,