dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle missing titles and usernames when importing log items
[lhc/web/wiklou.git]
/
maintenance
/
importDump.php
diff --git
a/maintenance/importDump.php
b/maintenance/importDump.php
index
bf59495
..
6b7cfb6
100644
(file)
--- a/
maintenance/importDump.php
+++ b/
maintenance/importDump.php
@@
-119,7
+119,8
@@
TEXT;
private function getNsIndex( $namespace ) {
global $wgContLang;
private function getNsIndex( $namespace ) {
global $wgContLang;
- if ( ( $result = $wgContLang->getNsIndex( $namespace ) ) !== false ) {
+ $result = $wgContLang->getNsIndex( $namespace );
+ if ( $result !== false ) {
return $result;
}
$ns = intval( $namespace );
return $result;
}
$ns = intval( $namespace );
@@
-134,16
+135,24
@@
TEXT;
* @return bool
*/
private function skippedNamespace( $obj ) {
* @return bool
*/
private function skippedNamespace( $obj ) {
+ $title = null;
if ( $obj instanceof Title ) {
if ( $obj instanceof Title ) {
- $
ns = $obj->getNamespace()
;
+ $
title = $obj
;
} elseif ( $obj instanceof Revision ) {
} elseif ( $obj instanceof Revision ) {
- $
ns = $obj->getTitle()->getNamespac
e();
+ $
title = $obj->getTitl
e();
} elseif ( $obj instanceof WikiRevision ) {
} elseif ( $obj instanceof WikiRevision ) {
- $
ns = $obj->title->getNamespace()
;
+ $
title = $obj->title
;
} else {
throw new MWException( "Cannot get namespace of object in " . __METHOD__ );
}
} 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 );
}
return is_array( $this->nsFilter ) && !in_array( $ns, $this->nsFilter );
}