r80508 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80507‎ | r80508 | r80509 >
Date:19:02, 18 January 2011
Author:werdna
Status:ok
Tags:
Comment:
Fix bug in XML data dump processing by guarding against missing title objects (database corruption)
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -177,8 +177,13 @@
178178 $attribs = array();
179179 $attribs['ThreadSubject'] = $thread->subject();
180180 if ( $thread->hasSuperThread() ) {
181 - $attribs['ThreadParent'] = $thread->superThread()->title()->getPrefixedText();
182 - $attribs['ThreadAncestor'] = $thread->topmostThread()->title()->getPrefixedText();
 181+ if ( $thread->superThread()->title() ) {
 182+ $attribs['ThreadParent'] = $thread->superThread()->title()->getPrefixedText();
 183+ }
 184+
 185+ if ( $thread->topmostThread()->title() ) {
 186+ $attribs['ThreadAncestor'] = $thread->topmostThread()->title()->getPrefixedText();
 187+ }
183188 }
184189 $attribs['ThreadPage'] = $thread->getTitle()->getPrefixedText();
185190 $attribs['ThreadID'] = $thread->id();

Status & tagging log