Do not try to parse empty argument in getErrorsOrWarnings in OOUI
authorAmir Sarabadani <ladsgroup@gmail.com>
Mon, 12 Jun 2017 11:33:17 +0000 (16:03 +0430)
committerAmir Sarabadani <ladsgroup@gmail.com>
Mon, 12 Jun 2017 11:33:17 +0000 (16:03 +0430)
Bug: T167644
Change-Id: I0dcb9bd51ad0cecbdab868fed056b4077d1c9fa8

includes/htmlform/OOUIHTMLForm.php

index 6650321..ed99802 100644 (file)
@@ -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.' );
                }