put in r110285 again now that 1.19 branched
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Thu, 9 Feb 2012 01:34:20 +0000 (01:34 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Thu, 9 Feb 2012 01:34:20 +0000 (01:34 +0000)
includes/Title.php

index b91c55c..b7eea8b 100644 (file)
@@ -4164,7 +4164,21 @@ class Title {
         * @return Bool
         */
        public function isKnown() {
-               return $this->isAlwaysKnown() || $this->exists();
+               $isKnown = null;
+               
+               /**
+                * Allows overriding default behaviour for determining if a page exists.
+                * If $isKnown is kept as null, regular checks happen. If it's
+                * a boolean, this value is returned by the isKnown method.
+                * 
+                * @since 1.20
+                * 
+                * @param Title $title
+                * @param boolean|null $isKnown
+                */
+               wfRunHooks( 'TitleIsKnown', array( $this, &$isKnown ) );
+               
+               return is_null( $isKnown ) ? ( $this->isAlwaysKnown() || $this->exists() ) : $isKnown;
        }
 
        /**