In some cases, e.g. changes in Unicode normalization rules or
MediaWiki banning some invisible characters that were previously
allowed in titles, it's enough to just run the title through
normalization and update the database entry.
Change-Id: I786f31510bbd58c2ec02fc91918de5241c9050d6
|| $title->getInterwiki()
|| !$title->canExist()
) {
|| $title->getInterwiki()
|| !$title->canExist()
) {
- if ( $title->getInterwiki() || !$title->canExist() ) {
+ $titleImpossible = $title->getInterwiki() || !$title->canExist();
+ if ( $titleImpossible ) {
$prior = $title->getPrefixedDBkey();
} else {
$prior = $title->getDBkey();
$prior = $title->getPrefixedDBkey();
} else {
$prior = $title->getDBkey();
- $clean = 'Broken/' . $prior;
+ if ( !$titleImpossible && !$title->exists() ) {
+ // Looks like the current title, after cleaning it up, is valid and available
+ $clean = $prior;
+ } else {
+ $clean = 'Broken/' . $prior;
+ }
$verified = Title::makeTitleSafe( $ns, $clean );
if ( !$verified || $verified->exists() ) {
$blah = "Broken/id:" . $row->page_id;
$verified = Title::makeTitleSafe( $ns, $clean );
if ( !$verified || $verified->exists() ) {
$blah = "Broken/id:" . $row->page_id;