Merge "Fix invalid namespace restriction when js is disabled"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 29 Mar 2019 20:17:57 +0000 (20:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 29 Mar 2019 20:17:57 +0000 (20:17 +0000)
includes/htmlform/fields/HTMLNamespacesMultiselectField.php

index 5ad1a4d..bd492d1 100644 (file)
@@ -45,6 +45,10 @@ class HTMLNamespacesMultiselectField extends HTMLSelectNamespace {
                }
 
                foreach ( $namespaces as $namespace ) {
+                       if ( $namespace < 0 ) {
+                               return $this->msg( 'htmlform-select-badoption' );
+                       }
+
                        $result = parent::validate( $namespace, $alldata );
                        if ( $result !== true ) {
                                return $result;