$this->watch = $wgRequest->getCheck( 'wpWatch' );
}
- function showForm( $err ) {
+ function showForm( $err, $hookErr = '' ) {
global $wgOut, $wgUser, $wgContLang;
$start = $wgContLang->isRTL() ? 'right' : 'left';
$wgOut->showErrorPage( 'notargettitle', 'notargettext' );
return;
}
+ $sk = $wgUser->getSkin();
+ $oldTitleLink = $sk->makeLinkObj( $ot );
$oldTitle = $ot->getPrefixedText();
$encOldTitle = htmlspecialchars( $oldTitle );
if ( $err != '' ) {
$wgOut->setSubtitle( wfMsg( 'formerror' ) );
- $wgOut->addWikiText( '<p class="error">' . wfMsg($err) . "</p>\n" );
+ $errMsg = "";
+ if( $err == 'hookaborted' ) {
+ $errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n";
+ } else {
+ $errMsg = '<p><strong class="error">' . wfMsgWikiHtml( $err ) . "</strong></p>\n";
+ }
+ $wgOut->addHTML( $errMsg );
}
$moveTalkChecked = $this->moveTalk ? ' checked="checked"' : '';
<table border='0'>
<tr>
<td align='$end'>{$movearticle}</td>
- <td align='$start'><strong>{$oldTitle}</strong></td>
+ <td align='$start'><strong>{$oldTitleLink}</strong></td>
</tr>
<tr>
<td align='$end'><label for='wpNewTitle'>{$newtitle}</label></td>
<input type='hidden' name='wpEditToken' value=\"{$token}\" />
</form>\n" );
- $this->showLogFragment( $ot, $wgOut );
+ $this->showLogFragment( $ot, $wgOut );
}
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 );
$talkmoved = $wgRequest->getVal( 'talkmoved' );
$oldUrl = $old->getFullUrl( 'redirect=no' );
$newUrl = $new->getFullURl();
- $oldText = $old->getPrefixedText();
- $newText = $new->getPrefixedText();
+ $oldText = wfEscapeWikiText( $old->getPrefixedText() );
+ $newText = wfEscapeWikiText( $new->getPrefixedText() );
$oldLink = "<span class='plainlinks'>[$oldUrl $oldText]</span>";
$newLink = "<span class='plainlinks'>[$newUrl $newText]</span>";