* (bug 11810) Localize displayed semicolons
* (bug 11657) Support for Thai solar calendar
* (bug 943) RSS feed for Recentchangeslinked
+* Introduced AbortMove hook
=== Bug fixes in 1.12 ===
default is LoginForm::ABORTED. Note that the client may be using
a machine API rather than the HTML user interface.
+'AbortMove': allows to abort moving an article (title)
+$old: old title
+$nt: new title
+$user: user who is doing the move
+$err: error message
+
'AbortNewAccount': Return false to cancel account creation.
$user: the User object about to be created (read-only, incomplete)
$message: out parameter: error message to display on abort
$this->watch = $wgRequest->getCheck( 'wpWatch' );
}
- function showForm( $err ) {
+ function showForm( $err, $hookErr = '' ) {
global $wgOut, $wgUser, $wgContLang;
$start = $wgContLang->isRTL() ? 'right' : 'left';
if ( $err != '' ) {
$wgOut->setSubtitle( wfMsg( 'formerror' ) );
- $wgOut->addWikiText( '<p class="error">' . wfMsg($err) . "</p>\n" );
+ $errMsg = "";
+ if( $err == 'hookaborted' ) {
+ $errMsg = $hookErr;
+ } else {
+ $errMsg = '<p class="error">' . wfMsgWikiHtml( $err ) . "</p>\n";
+ }
+ $wgOut->addHTML( $errMsg );
}
$moveTalkChecked = $this->moveTalk ? ' checked="checked"' : '';
return;
}
+ $hookErr = null;
+ if( !wfRunHooks( 'AbortMove', array( $ot, $nt, $wgUser, &$hookErr ) ) ) {
+ $this->showForm( 'hookaborted', $hookErr );
+ return;
+ }
+
$error = $ot->moveTo( $nt, true, $this->reason );
if ( $error !== true ) {
$this->showForm( $error );
return 'protectedpage';
}
+ global $wgUser;
+ $err = null;
+ if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err ) ) ) {
+ return 'hookaborted';
+ }
+
# The move is allowed only if (1) the target doesn't exist, or
# (2) the target is a redirect to the source, and has no history
# (so we can undo bad moves right after they're done).