WikiPage: Use Title::isKnown() in hasViewableContent()
authorKunal Mehta <legoktm@member.fsf.org>
Tue, 13 Sep 2016 04:27:25 +0000 (21:27 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Tue, 13 Sep 2016 04:46:28 +0000 (21:46 -0700)
The current implementation of hasViewableContent() is basically the same
as Title::isKnown(), except that it switched the order of
isAlwaysKnown() and exists(). (Also it used WikiPage::exists() instead
of Title::exists(), but they're functionality equivalent).

This will make refactoring Title::isAlwaysKnown() easier in the future
as there is one less caller.

Change-Id: I698f08fb0f3e6c3bc702ec7d523d7eda063e18ca

includes/page/WikiPage.php

index 938f292..fcc77a0 100644 (file)
@@ -460,7 +460,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @return bool
         */
        public function hasViewableContent() {
-               return $this->exists() || $this->mTitle->isAlwaysKnown();
+               return $this->mTitle->isKnown();
        }
 
        /**