From: Jan Gerber Date: Thu, 12 Sep 2013 10:13:21 +0000 (+0000) Subject: Add TitleMove hook X-Git-Tag: 1.31.0-rc.0~18755^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=386ba287d7716007e6a448674e0375bec15abbb1;p=lhc%2Fweb%2Fwiklou.git Add TitleMove hook some things need access to the old file before its moved, adding hook to allow extensions to do something before file is moved. Change-Id: Ic5e659abc79c41e3331d42074e7f21eec9b9ba7c --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index e503e30195..04985c850d 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -212,6 +212,7 @@ production. * IPv6 addresses in X-Forwarded-For headers are now normalised before checking against allowed proxy lists. * Add deferrable update support for callback/closure +* Add TitleMove hook before page renames === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one diff --git a/docs/hooks.txt b/docs/hooks.txt index 02413b392b..5d6a6e420a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2419,6 +2419,11 @@ $result: Boolean; whether MediaWiki currently thinks this is a wikitext page. Hooks may change this value to override the return value of Title::isWikitextPage() +'TitleMove': Before moving an article (title). +$old: old title +$nt: new title +$user: user who does the move + 'TitleMoveComplete': After moving an article (title). $old: old title $nt: new title diff --git a/includes/Title.php b/includes/Title.php index 734e009e8a..3e6f11bd1e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3620,6 +3620,8 @@ class Title { $createRedirect = true; } + wfRunHooks( 'TitleMove', array( $this, $nt, $wgUser ) ); + // If it is a file, move it first. // It is done before all other moving stuff is done because it's hard to revert. $dbw = wfGetDB( DB_MASTER );