catch exceptions while generating auto delete reason
authorDaniel Kinzler <daniel.kinzler@wikimedia.de>
Wed, 28 Mar 2012 13:09:21 +0000 (13:09 +0000)
committerDaniel Kinzler <daniel.kinzler@wikimedia.de>
Wed, 4 Apr 2012 18:00:05 +0000 (20:00 +0200)
includes/Article.php

index 249d48f..5470dbc 100644 (file)
@@ -1384,7 +1384,13 @@ class Article extends Page {
                // Generate deletion reason
                $hasHistory = false;
                if ( !$reason ) {
-                       $reason = $this->generateReason( $hasHistory );
+            try {
+                $reason = $this->generateReason( $hasHistory );
+            } catch (MWException $e) {
+                # if a page is horribly broken, we still want to be able to delete it. so be lenient about errors here.
+                wfDebug("Error while building auto delete summary: $e");
+                $reason = '';
+            }
                }
 
                // If the page has a history, insert a warning