aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/importDump.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/importDump.php')
-rw-r--r--maintenance/importDump.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index 8cea5a2c5db0..6b7cfb6ac1bf 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -135,16 +135,24 @@ TEXT;
* @return bool
*/
private function skippedNamespace( $obj ) {
+ $title = null;
if ( $obj instanceof Title ) {
- $ns = $obj->getNamespace();
+ $title = $obj;
} elseif ( $obj instanceof Revision ) {
- $ns = $obj->getTitle()->getNamespace();
+ $title = $obj->getTitle();
} elseif ( $obj instanceof WikiRevision ) {
- $ns = $obj->title->getNamespace();
+ $title = $obj->title;
} else {
throw new MWException( "Cannot get namespace of object in " . __METHOD__ );
}
+ if ( is_null( $title ) ) {
+ // Probably a log entry
+ return false;
+ }
+
+ $ns = $title->getNamespace();
+
return is_array( $this->nsFilter ) && !in_array( $ns, $this->nsFilter );
}