From: Daniel Kinzler Date: Wed, 28 Mar 2012 13:09:21 +0000 (+0000) Subject: catch exceptions while generating auto delete reason X-Git-Tag: 1.31.0-rc.0~22097^2^2~274 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=3c4d0de9bd7f42f5385de91ed0aff080fb7114a7;p=lhc%2Fweb%2Fwiklou.git catch exceptions while generating auto delete reason --- 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