From cfb755c7fdfea44b4d641c57bf0cef306cd91648 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 6 Mar 2014 19:31:16 -0800 Subject: [PATCH] Handle exceptions when testing row validity This bit of special contributions, according to its comment, is intentionally ignoring errors. Also swallow exceptions with the same expectations. Change-Id: I82ceb0b223159c71796f64a890cf6209a6544209 --- includes/specials/SpecialContributions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index fdb781bf4a..636e7962cb 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -941,8 +941,12 @@ class ContribsPager extends ReverseChronologicalPager { * to extensions to subscribe to the hook to parse the row. */ wfSuppressWarnings(); - $rev = new Revision( $row ); - $validRevision = (bool)$rev->getId(); + try { + $rev = new Revision( $row ); + $validRevision = (bool)$rev->getId(); + } catch ( MWException $e ) { + $validRevision = false; + } wfRestoreWarnings(); if ( $validRevision ) { -- 2.20.1