https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114553

Revision: 114553
Author:   daniel
Date:     2012-03-28 13:09:21 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
catch exceptions while generating auto delete reason

Modified Paths:
--------------
    branches/Wikidata/phase3/includes/Article.php

Modified: branches/Wikidata/phase3/includes/Article.php
===================================================================
--- branches/Wikidata/phase3/includes/Article.php       2012-03-28 13:07:23 UTC 
(rev 114552)
+++ branches/Wikidata/phase3/includes/Article.php       2012-03-28 13:09:21 UTC 
(rev 114553)
@@ -1384,7 +1384,13 @@
                // 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


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to