Collapse some nested if statements
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLTitlesMultiselectField.php
index 1cfbd5f..bd1d2d3 100644 (file)
@@ -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 ) {