From: Amir Sarabadani Date: Mon, 12 Jun 2017 11:33:17 +0000 (+0430) Subject: Do not try to parse empty argument in getErrorsOrWarnings in OOUI X-Git-Tag: 1.31.0-rc.0~3007^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=8cd74081f706d5f2b1986475adbbb90632605944;p=lhc%2Fweb%2Fwiklou.git Do not try to parse empty argument in getErrorsOrWarnings in OOUI Bug: T167644 Change-Id: I0dcb9bd51ad0cecbdab868fed056b4077d1c9fa8 --- diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index 6650321633..ed99802994 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -191,6 +191,10 @@ class OOUIHTMLForm extends HTMLForm { * @return string */ public function getErrorsOrWarnings( $elements, $elementsType ) { + if ( $elements === '' ) { + return ''; + } + if ( !in_array( $elementsType, [ 'error', 'warning' ], true ) ) { throw new DomainException( $elementsType . ' is not a valid type.' ); }