Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLTitlesMultiselectField.php
index 6fef23b..bd1d2d3 100644 (file)
@@ -7,7 +7,7 @@ use MediaWiki\Widget\TitlesMultiselectWidget;
  *
  * Besides the parameters recognized by HTMLTitleTextField, additional recognized
  * parameters are:
- *  default - (optional) Array of usernames to use as preset data
+ *  default - (optional) Array of titles to use as preset data
  *  placeholder - (optional) Custom placeholder message for input
  *
  * The result is the array of titles
@@ -53,10 +53,8 @@ class HTMLTitlesMultiselectField extends HTMLTitleTextField {
                // $value is a string, because HTMLForm fields store their values as strings
                $titlesArray = explode( "\n", $value );
 
-               if ( isset( $this->mParams['max'] ) ) {
-                       if ( count( $titlesArray ) > $this->mParams['max'] ) {
-                               return $this->msg( 'htmlform-int-toohigh', $this->mParams['max'] );
-                       }
+               if ( isset( $this->mParams['max'] ) && ( count( $titlesArray ) > $this->mParams['max'] ) ) {
+                       return $this->msg( 'htmlform-int-toohigh', $this->mParams['max'] );
                }
 
                foreach ( $titlesArray as $title ) {
@@ -102,6 +100,9 @@ class HTMLTitlesMultiselectField extends HTMLTitleTextField {
                if ( isset( $this->mParams['showMissing'] ) ) {
                        $params['showMissing'] = $this->mParams['showMissing'];
                }
+               if ( isset( $this->mParams['excludeDynamicNamespaces'] ) ) {
+                       $params['excludeDynamicNamespaces'] = $this->mParams['excludeDynamicNamespaces'];
+               }
 
                if ( isset( $this->mParams['input'] ) ) {
                        $params['input'] = $this->mParams['input'];