r71875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71874‎ | r71875 | r71876 >
Date:10:45, 29 August 2010
Author:werdna
Status:deferred
Tags:
Comment:
Fix infinite loop
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Thread.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Thread.php
@@ -323,9 +323,12 @@
324324 }
325325 }
326326
327 - function delete( $reason ) {
328 - $this->type = Threads::TYPE_DELETED;
329 - $this->commitRevision( Threads::CHANGE_DELETED, $this, $reason );
 327+ function delete( $reason, $commit = true ) {
 328+
 329+ if ( $commit ) {
 330+ $this->type = Threads::TYPE_DELETED;
 331+ $this->commitRevision( Threads::CHANGE_DELETED, $this, $reason );
 332+ }
330333 /* Mark thread as read by all users, or we get blank thingies in New Messages. */
331334
332335 $this->dieIfHistorical();
@@ -1154,9 +1157,8 @@
11551158 $title = Title::newFromID( $this->rootId );
11561159 }
11571160
1158 - if ( !$title ) {
1159 - $this->setType( Threads::TYPE_DELETED );
1160 - $this->save();
 1161+ if ( !$title && $this->type() != Threads::TYPE_DELETED ) {
 1162+ $this->delete('', false /* !commit */);
11611163 return null;
11621164 }
11631165

Status & tagging log