array( 'required' => false ) will now result in the field not being required rather then the unexpected opossite.
And this is now possible (without doing some extra if)
array( 'required' => getSomeBoolean() )
Change-Id: I1fc22b16ab1fa17111c48aa664aaf47de5f7075a
* @return Mixed Bool true on success, or String error to display.
*/
function validate( $value, $alldata ) {
- if ( isset( $this->mParams['required'] ) && $value === '' ) {
+ if ( isset( $this->mParams['required'] ) && $this->mParams['required'] !== false && $value === '' ) {
return wfMsgExt( 'htmlform-required', 'parseinline' );
}
return $p;
}
- if ( isset( $this->mParams['required'] ) && $value[1] === '' ) {
+ if ( isset( $this->mParams['required'] ) && $this->mParams['required'] !== false && $value[1] === '' ) {
return wfMsgExt( 'htmlform-required', 'parseinline' );
}