From df1f744757b0ce695e6aa1e4a28f6c50fe6d8e20 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 2 Jan 2009 19:52:57 +0000 Subject: [PATCH] (bug 16839) cleanupTitles and namespaceDupes shouldn't consider 'Special' or 'Media' valid title targets --- includes/Title.php | 9 +++++++++ maintenance/cleanupTitles.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index a35dbb40a4..17107c7986 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3172,6 +3172,15 @@ class Title { public function isKnown() { return $this->exists() || $this->isAlwaysKnown(); } + + /** + * Is this in a namespace that allows actual pages? + * + * @return \type{\bool} TRUE or FALSE + */ + public function canExist() { + return $this->mNamespace >= 0 && $this->mNamespace != NS_MEDIA; + } /** * Update page_touched timestamps and send squid purge messages for diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index 3f29d31cf9..4d76ac7ac7 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -48,7 +48,7 @@ class TitleCleanup extends TableCleanup { $title = Title::newFromText( $verified ); - if( !is_null( $title ) && $title->equals( $current ) ) { + if( !is_null( $title ) && $title->equals( $current ) && $title->canExist() ) { return $this->progress( 0 ); // all is fine } -- 2.20.1