http://www.mediawiki.org/wiki/Special:Code/MediaWiki/71875
Revision: 71875
Author: werdna
Date: 2010-08-29 10:45:37 +0000 (Sun, 29 Aug 2010)
Log Message:
-----------
Fix infinite loop
Modified Paths:
--------------
trunk/extensions/LiquidThreads/classes/Thread.php
Modified: trunk/extensions/LiquidThreads/classes/Thread.php
===================================================================
--- trunk/extensions/LiquidThreads/classes/Thread.php 2010-08-29 10:32:02 UTC
(rev 71874)
+++ trunk/extensions/LiquidThreads/classes/Thread.php 2010-08-29 10:45:37 UTC
(rev 71875)
@@ -323,9 +323,12 @@
}
}
- function delete( $reason ) {
- $this->type = Threads::TYPE_DELETED;
- $this->commitRevision( Threads::CHANGE_DELETED, $this, $reason
);
+ function delete( $reason, $commit = true ) {
+
+ if ( $commit ) {
+ $this->type = Threads::TYPE_DELETED;
+ $this->commitRevision( Threads::CHANGE_DELETED, $this,
$reason );
+ }
/* Mark thread as read by all users, or we get blank thingies
in New Messages. */
$this->dieIfHistorical();
@@ -1154,9 +1157,8 @@
$title = Title::newFromID( $this->rootId );
}
- if ( !$title ) {
- $this->setType( Threads::TYPE_DELETED );
- $this->save();
+ if ( !$title && $this->type() != Threads::TYPE_DELETED
) {
+ $this->delete('', false /* !commit */);
return null;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs