From 33a913d27fd897eca941e16124c022c0456cda3b Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 3 Mar 2008 16:22:36 +0000 Subject: [PATCH] (bug 13166) Adding TitleSecureAndSplit hook. Modified patch by Joshua Bacher --- docs/hooks.txt | 4 ++++ includes/Title.php | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index eebdfe7328..db132f7f16 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1021,6 +1021,10 @@ $user: user who did the move $pageid: database ID of the page that's been moved $redirid: database ID of the created redirect +'TitleSecureAndSplit': At the end of Title::secureAndSplit() +$title: The Title object +$dbkey: The DB key + 'UndeleteShowRevision': called when showing a revision in Special:Undelete $title: title object related to the revision $rev: revision (object) that will be viewed diff --git a/includes/Title.php b/includes/Title.php index ea2b197342..ff8a234c72 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2107,8 +2107,9 @@ class Title { $this->mUrlform = wfUrlencode( $dbkey ); $this->mTextform = str_replace( '_', ' ', $dbkey ); - - return true; + + # Hooks can reject titles by returning false + return wfRunHooks('TitleSecureAndSplit', array( $this, &$dbkey )); } /** -- 2.20.1