From bb985c782704f25f4f9adb61b491e086e90c4cfe Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 12 Aug 2014 20:46:31 +0200 Subject: [PATCH] Correctly handle incorrect namespace in cleanupTitles.php If the namespace is not valid; Title::makeTitleSafe() will return null, thus producing a fatal error. Work arround this by setting the namespace to 0 in that case. Bug: 68501 Change-Id: I0c22f9468ff2bf11d2bf4a9265fa454ece2c0fa3 --- maintenance/cleanupTitles.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index 72b6aa59a0..eee1204668 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -148,6 +148,12 @@ class TitleCleanup extends TableCleanup { $ns = 0; } + # Namespace which no longer exists. Put the page in the main namespace + # since we don't have any idea of the old namespace name. See bug 68501. + if ( !MWNamespace::exists( $ns ) ) { + $ns = 0; + } + $clean = 'Broken/' . $prior; $verified = Title::makeTitleSafe( $ns, $clean ); if ( $verified->exists() ) { -- 2.20.1