From: Alexandre Emsenhuber Date: Tue, 12 Aug 2014 18:46:31 +0000 (+0200) Subject: Correctly handle incorrect namespace in cleanupTitles.php X-Git-Tag: 1.31.0-rc.0~14433^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=bb985c782704f25f4f9adb61b491e086e90c4cfe;p=lhc%2Fweb%2Fwiklou.git 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 --- 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() ) {