From dfb8cf2d03d407032b39e3a66cc428cd9654c94c Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sat, 26 Jul 2008 21:38:51 +0000 Subject: [PATCH] SpecialMovepageBeforeMove hook from Wikia codebase - allows extensions, such as spamRegex, to interfere with page moving --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 3 +++ includes/specials/SpecialMovepage.php | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a390a1c6a4..dcfb640441 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -32,6 +32,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN search engine indexing on a per-article basis. * Added ConfirmEmailComplete hook to allow extensions to perform actions depending on if the user's email is confirmed or not +* Added SpecialMovepageBeforeMove hook to allow extensions to interfere with + page moves (useful for blacklist-type extensions, for example) === Bug fixes in 1.14 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 8623599b70..8d60b0cde9 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1134,6 +1134,9 @@ $movePage: MovePageForm object $oldTitle: old title (object) $newTitle: new title (object) +'SpecialMovepageBeforeMove': Called before moving a page +&$this: the submitted form object + 'SpecialPageExecuteAfterPage': called after executing a special page Warning: Not all the special pages call this hook $specialPage: SpecialPage object diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 9f8bd3e89b..5cda361fb9 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -264,6 +264,10 @@ class MovePageForm { return; } + if( ! wfRunHooks( 'SpecialMovepageBeforeMove', array(&$this) ) ) { + return; + } + $ot = $this->oldTitle; $nt = $this->newTitle; -- 2.20.1