From 7f9fe1b29df6ecee9a9c90f6806d7bf8848ff0b1 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Wed, 31 Oct 2012 16:59:50 -0400 Subject: [PATCH] Remove the throw from Message::extractParam() Per Tim Starling's comment on bug 41400, I replaced the throw (when a message parameter is invalid) with a call to trigger_error(). The string [INVALID] is used as a placeholder to make it clear from the output that an error has occurred. Change-Id: I974d55d44d392c956e7de6d243da9d8dc07d8833 --- includes/Message.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/Message.php b/includes/Message.php index 5a4b810d1e..abc7dc4b31 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -606,7 +606,6 @@ class Message { * @since 1.18 * @param $param String|Array: Parameter as defined in this class. * @return Tuple(type, value) - * @throws MWException */ protected function extractParam( $param ) { if ( is_array( $param ) && isset( $param['raw'] ) ) { @@ -618,7 +617,11 @@ class Message { } elseif ( !is_array( $param ) ) { return array( 'before', $param ); } else { - throw new MWException( "Invalid message parameter: " . serialize( $param ) ); + trigger_error( + "Invalid message parameter: " . htmlspecialchars( serialize( $param ) ), + E_USER_WARNING + ); + return array( 'before', '[INVALID]' ); } } -- 2.20.1