Index: trunk/phase3/includes/Title.php |
— | — | @@ -28,7 +28,8 @@ |
29 | 29 | * |
30 | 30 | * @internal documentation reviewed 15 Mar 2010 |
31 | 31 | */ |
32 | | -class Title { |
| 32 | +class |
| 33 | +Title { |
33 | 34 | /** @name Static cache variables */ |
34 | 35 | // @{ |
35 | 36 | static private $titleCache = array(); |
— | — | @@ -4164,7 +4165,21 @@ |
4165 | 4166 | * @return Bool |
4166 | 4167 | */ |
4167 | 4168 | public function isKnown() { |
4168 | | - return $this->isAlwaysKnown() || $this->exists(); |
| 4169 | + $isKnown = null; |
| 4170 | + |
| 4171 | + /** |
| 4172 | + * Allows overriding default behaviour for determining if a page exists. |
| 4173 | + * If $isKnown is kept as null, regular checks happen. If it's |
| 4174 | + * a boolean, this value is returned by the isKnown method. |
| 4175 | + * |
| 4176 | + * @since 1.19 |
| 4177 | + * |
| 4178 | + * @param Title $title |
| 4179 | + * @param boolean|null $isKnown |
| 4180 | + */ |
| 4181 | + wfRunHooks( 'TitleIsKnown', array( $this, &$isKnown ) ); |
| 4182 | + |
| 4183 | + return is_null( $isKnown ) ? ( $this->isAlwaysKnown() || $this->exists() ) : $isKnown; |
4169 | 4184 | } |
4170 | 4185 | |
4171 | 4186 | /** |