From 8cd74081f706d5f2b1986475adbbb90632605944 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Mon, 12 Jun 2017 16:03:17 +0430 Subject: [PATCH] Do not try to parse empty argument in getErrorsOrWarnings in OOUI Bug: T167644 Change-Id: I0dcb9bd51ad0cecbdab868fed056b4077d1c9fa8 --- includes/htmlform/OOUIHTMLForm.php | 4 ++++ 1 file changed, 4 insertions(+) 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.' ); } -- 2.20.1