Followup r78786: pass $fname in the raw SQL case too
[lhc/web/wiklou.git] / includes / WatchedItem.php
index a2c1f03..0cf8a77 100644 (file)
@@ -62,7 +62,7 @@ class WatchedItem {
                        'wl_user' => $this->id,
                        'wl_namespace' => MWNamespace::getSubject($this->ns),
                        'wl_title' => $this->ti,
-                       'wl_notificationtimestamp' => NULL
+                       'wl_notificationtimestamp' => null
                  ), __METHOD__, 'IGNORE' );
 
                // Every single watched page needs now to be listed in watchlist;
@@ -72,7 +72,7 @@ class WatchedItem {
                        'wl_user' => $this->id,
                        'wl_namespace' => MWNamespace::getTalk($this->ns),
                        'wl_title' => $this->ti,
-                       'wl_notificationtimestamp' => NULL
+                       'wl_notificationtimestamp' => null
                  ), __METHOD__, 'IGNORE' );
 
                wfProfileOut( __METHOD__ );
@@ -143,14 +143,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