I have a basic model defined:
protected function defineAttributes()
{
return array(
'id' => array(AttributeType::String, 'required' => true),
'url' => AttributeType::Url,
'info' => array(AttributeType::String, 'required' => true, 'maxLength' => 4000),
'title' => array(AttributeType::String, 'required' => true, 'maxLength' => 65, 'minLength' => 15),
'message' => AttributeType::String,
);
}
And when checking if the model is valid:
if (!$my_model->validate())
{
return false;
}
Almost any string for 'url' is passing the validation, even without a '.com'
So if someone inputs sdfsdfsfsdfsdf in the input field, it'll pass as a valid URL and return as http://sdfsdfsfsdfsdf
I've also tried using AttributeType::UrlFormat but I run into the same problem. Am I not understanding what this attributetype does, or should it be validating that it's an actual URL string?