# Protect the redirect title as the title used to be...
$res = $dbw->select(
'page_restrictions',
- '*',
+ [ 'pr_type', 'pr_level', 'pr_cascade', 'pr_user', 'pr_expiry' ],
[ 'pr_page' => $pageid ],
__METHOD__,
'FOR UPDATE'
* @throws MWException
*/
private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true,
- array $changeTags = [] ) {
-
- global $wgContLang;
+ array $changeTags = []
+ ) {
if ( $nt->exists() ) {
$moveOverRedirect = true;
$logType = 'move_redir';
$overwriteMessage = wfMessage(
'delete_and_move_reason',
$this->oldTitle->getPrefixedText()
- )->text();
+ )->inContentLanguage()->text();
$newpage = WikiPage::factory( $nt );
$errs = [];
$status = $newpage->doDeleteArticleReal(
$logEntry->setComment( $reason );
$logEntry->setParameters( [
'4::target' => $nt->getPrefixedText(),
- '5::noredir' => $redirectContent ? '0': '1',
+ '5::noredir' => $redirectContent ? '0' : '1',
] );
$formatter = LogFormatter::newFromEntry( $logEntry );
if ( $reason ) {
$comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
}
- # Truncate for whole multibyte characters.
- $comment = $wgContLang->truncate( $comment, 255 );
$dbw = wfGetDB( DB_MASTER );
$redirectArticle->doEditUpdates( $redirectRevision, $user, [ 'created' => true ] );
- ChangeTags::addTags( $changeTags, null, $redirectRevId, null );
+ // make a copy because of log entry below
+ $redirectTags = $changeTags;
+ if ( in_array( 'mw-new-redirect', ChangeTags::getSoftwareTags() ) ) {
+ $redirectTags[] = 'mw-new-redirect';
+ }
+ ChangeTags::addTags( $redirectTags, null, $redirectRevId, null );
}
}