From 3c4d0de9bd7f42f5385de91ed0aff080fb7114a7 Mon Sep 17 00:00:00 2001 From: Daniel Kinzler Date: Wed, 28 Mar 2012 13:09:21 +0000 Subject: [PATCH] catch exceptions while generating auto delete reason --- includes/Article.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index 249d48f3a0..5470dbcac7 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 -- 2.20.1