Merge "Check for invalid new titles"

This commit is contained in:
jenkins-bot 2022-09-08 13:32:34 +00:00 committed by Gerrit Code Review
commit cb08a9a768

View file

@ -426,7 +426,7 @@ class SpecialReplaceText extends SpecialPage {
foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
if ( $title == null ) {
if ( !$title ) {
continue;
}
@ -436,6 +436,11 @@ class SpecialReplaceText extends SpecialPage {
$this->replacement,
$this->use_regex
);
if ( !$new_title ) {
// New title is not valid because it contains invalid characters.
$unmoveable_titles[] = $title;
continue;
}
$mvPage = $this->movePageFactory->newMovePage( $title, $new_title );
$moveStatus = $mvPage->isValidMove();