From: Kevin Israel Date: Wed, 31 Oct 2012 20:59:50 +0000 (-0400) Subject: Remove the throw from Message::extractParam() X-Git-Tag: 1.31.0-rc.0~21465 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=7f9fe1b29df6ecee9a9c90f6806d7bf8848ff0b1;p=lhc%2Fweb%2Fwiklou.git 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 --- 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]' ); } }