mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
26 lines
645 B
Markdown
26 lines
645 B
Markdown
# 3.2.1
|
|
|
|
## Upgrading
|
|
|
|
FormField validation messages generated by the `Validator` class will now be automatically XML
|
|
encoded before being rendered alongside an invalid field.
|
|
|
|
If a validation message in a custom `Validator` instance should be rendered as literal HTML,
|
|
then the $message parameter for `Validator::validationError` should be passed as an instance
|
|
of `HTMLText`
|
|
|
|
For example:
|
|
|
|
|
|
:::php
|
|
class MyCustomValidator extends Validator {
|
|
public function php($data) {
|
|
$this->validationError(
|
|
'EmailAddress',
|
|
DBField::create_field('HTMLText', "Invalid email. Please sign up at <a href='signup'>this page</a>")
|
|
);
|
|
}
|
|
}
|
|
|
|
|