if ( !$this->mParams['required'] && $value === '' ) {
// If this field is not required and the value is empty, that's okay, skip validation
return parent::validate( $value, $alldata );
if ( !$this->mParams['required'] && $value === '' ) {
// If this field is not required and the value is empty, that's okay, skip validation
return parent::validate( $value, $alldata );
$title = Title::newFromTextThrow( $value );
} else {
// Can't use Title::makeTitleSafe(), because it doesn't throw useful exceptions
$title = Title::newFromTextThrow( $value );
} else {
// Can't use Title::makeTitleSafe(), because it doesn't throw useful exceptions
$title = Title::newFromTextThrow( $namespaceName . ':' . $value );
}
} catch ( MalformedTitleException $e ) {
$title = Title::newFromTextThrow( $namespaceName . ':' . $value );
}
} catch ( MalformedTitleException $e ) {