X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWatchedItem.php;h=a6e75162e32c30636beec5e3840604477da6bdd8;hb=97a4ad455f836f779a056a4a53e57227b3ad0d1e;hp=d2fb4683351575c467479efcd801d6ffa46912a3;hpb=0182f3fb638750850b7a34018730e77f2fffd048;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index d2fb468335..a6e75162e3 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -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.