Add TitleExists hook

Bug: 70495
Change-Id: I4f9a04d09ff8c4bdda678a591aea7f1153cb0a40
This commit is contained in:
Jackmcbarn 2014-09-15 18:46:25 -04:00
parent aad7dad564
commit c15616690e
2 changed files with 7 additions and 1 deletions

View file

@ -2590,6 +2590,10 @@ database result.
&$titleArray: set this to an object to override the default object returned
$res: database result used to create the object
'TitleExists': Called when determining whether a page exists at a given title.
$title: The title being tested.
&$exists: Whether the title exists.
'TitleQuickPermissions': Called from Title::checkQuickPermissions to add to
or override the quick permissions check.
$title: The Title object being accessed

View file

@ -4608,7 +4608,9 @@ class Title {
* @return bool
*/
public function exists() {
return $this->getArticleID() != 0;
$exists = $this->getArticleID() != 0;
wfRunHooks( 'TitleExists', array( $this, &$exists ) );
return $exists;
}
/**