(bug 13166) Adding TitleSecureAndSplit hook. Modified patch by Joshua Bacher
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 3 Mar 2008 16:22:36 +0000 (16:22 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 3 Mar 2008 16:22:36 +0000 (16:22 +0000)
docs/hooks.txt
includes/Title.php

index eebdfe7..db132f7 100644 (file)
@@ -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
index ea2b197..ff8a234 100644 (file)
@@ -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 )); 
        }
 
        /**