Merge "Consistently use '@deprecated since <version>'"
[lhc/web/wiklou.git] / includes / WatchedItem.php
index d2fb468..a6e7516 100644 (file)
@@ -70,16 +70,26 @@ class WatchedItem {
                return $this->mTitle;
        }
 
-       /** Helper to retrieve the title namespace */
+       /**
+        * Helper to retrieve the title namespace
+        * @return int
+        */
        protected function getTitleNs() {
                return $this->getTitle()->getNamespace();
        }
 
-       /** Helper to retrieve the title DBkey */
+       /**
+        * Helper to retrieve the title DBkey
+        * @return string
+        */
        protected function getTitleDBkey() {
                return $this->getTitle()->getDBkey();
        }
-       /** Helper to retrieve the user id */
+
+       /**
+        * Helper to retrieve the user id
+        * @return int
+        */
        protected function getUserId() {
                return $this->mUser->getId();
        }
@@ -113,6 +123,12 @@ class WatchedItem {
                        return;
                }
 
+               // some pages cannot be watched
+               if ( !$this->getTitle()->isWatchable() ) {
+                       $this->watched = false;
+                       return;
+               }
+
                # Pages and their talk pages are considered equivalent for watching;
                # remember that talk namespaces are numbered as page namespace+1.