$request = $this->getRequest();
$target = !is_null( $par ) ? $par : $request->getVal( 'target' );
- // Yes, the use of getVal() and getText() is wanted, see bug 20365
+ // Yes, the use of getVal() and getText() is wanted, see T22365
$oldTitleText = $request->getVal( 'wpOldTitle', $target );
$this->oldTitle = Title::newFromText( $oldTitleText );
$permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $user );
if ( count( $permErrors ) ) {
// Auto-block user's IP if the account was "hard" blocked
- DeferredUpdates::addCallableUpdate( function() use ( $user ) {
+ DeferredUpdates::addCallableUpdate( function () use ( $user ) {
$user->spreadAnyEditBlock();
} );
throw new PermissionsError( 'move', $permErrors );
}
if ( count( $err ) ) {
- $out->addHTML( "<div class='errorbox'>\n" );
$action_desc = $this->msg( 'action-move' )->plain();
- $out->addWikiMsg( 'permissionserrorstext-withaction', count( $err ), $action_desc );
+ $errMsgHtml = $this->msg( 'permissionserrorstext-withaction',
+ count( $err ), $action_desc )->parseAsBlock();
if ( count( $err ) == 1 ) {
$errMsg = $err[0];
$errMsgName = array_shift( $errMsg );
if ( $errMsgName == 'hookaborted' ) {
- $out->addHTML( "<p>{$errMsg[0]}</p>\n" );
+ $errMsgHtml .= "<p>{$errMsg[0]}</p>\n";
} else {
- $out->addWikiMsgArray( $errMsgName, $errMsg );
+ $errMsgHtml .= $this->msg( $errMsgName, $errMsg )->parseAsBlock();
}
} else {
$errStr = [];
}
}
- $out->addHTML( '<ul><li>' . implode( "</li>\n<li>", $errStr ) . "</li></ul>\n" );
+ $errMsgHtml .= '<ul><li>' . implode( "</li>\n<li>", $errStr ) . "</li></ul>\n";
}
- $out->addHTML( "</div>\n" );
+ $out->addHTML( Html::errorBox( $errMsgHtml ) );
}
if ( $this->oldTitle->isProtected( 'move' ) ) {
$out->addHTML( "</div>\n" );
}
- // Byte limit (not string length limit) for wpReason and wpNewTitleMain
- // is enforced in the mediawiki.special.movePage module
+ // Length limit for wpReason and wpNewTitleMain is enforced in the
+ // mediawiki.special.movePage module
$immovableNamespaces = [];
foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
]
);
+ // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
+ // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
+ // Unicode codepoints (or 255 UTF-8 bytes for old schema).
+ $conf = $this->getConfig();
+ $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
$fields[] = new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'name' => 'wpReason',
'id' => 'wpReason',
- 'maxLength' => 200,
+ 'maxLength' => $oldCommentSchema ? 200 : CommentStore::COMMENT_CHARACTER_LIMIT,
'infusable' => true,
'value' => $this->reason,
] ),
// a redirect to the new title. This is not safe, but what we did before was
// even worse: we just determined whether a redirect should have been created,
// and reported that it was created if it should have, without any checks.
- // Also note that isRedirect() is unreliable because of bug 37209.
+ // Also note that isRedirect() is unreliable because of T39209.
$msgName = 'movepage-moved-redirect';
} else {
$msgName = 'movepage-moved-noredirect';
$newPageName = preg_replace(
'#^' . preg_quote( $ot->getDBkey(), '#' ) . '#',
- StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
+ StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # T23234
$oldSubpage->getDBkey()
);
$newNs = $nt->getSubjectPage()->getNamespace();
}
- # Bug 14385: we need makeTitleSafe because the new page names may
+ # T16385: we need makeTitleSafe because the new page names may
# be longer than 255 characters.
$newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
if ( !$newSubpage ) {
# Deal with watches (we don't watch subpages)
WatchAction::doWatchOrUnwatch( $this->watch, $ot, $user );
WatchAction::doWatchOrUnwatch( $this->watch, $nt, $user );
+
+ /**
+ * T163966
+ * Increment user_editcount during page moves
+ */
+ $user->incEditCount();
}
function showLogFragment( $title ) {