Merge "Fix SpecialBlock validation for ipb_allow_usertalk"
[lhc/web/wiklou.git] / includes / watcheditem / WatchedItemStore.php
index 51d9e32..c363029 100644 (file)
@@ -383,7 +383,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
 
        /**
         * @param UserIdentity $user
-        * @param TitleValue[] $titles
+        * @param LinkTarget[] $titles
         * @return bool
         * @throws MWException
         */
@@ -641,7 +641,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                        // @todo: Should we add these to the process cache?
                        $watchedItems[] = new WatchedItem(
                                $user,
-                               new TitleValue( (int)$row->wl_namespace, $row->wl_title ),
+                               $target,
                                $this->getLatestNotificationTimestamp(
                                        $row->wl_notificationtimestamp, $user, $target )
                        );
@@ -1120,6 +1120,11 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                }
 
                $oldRev = $this->revisionLookup->getRevisionById( $oldid );
+               if ( !$oldRev ) {
+                       // Oldid given but does not exist (probably deleted)
+                       return false;
+               }
+
                $nextRev = $this->revisionLookup->getNextRevision( $oldRev );
                if ( !$nextRev ) {
                        // Oldid given and is the latest revision for this title; clear the timestamp.