Merge "Do not try to parse empty argument in getErrorsOrWarnings in OOUI"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 12 Jun 2017 18:03:20 +0000 (18:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 12 Jun 2017 18:03:20 +0000 (18:03 +0000)
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.' );
                }