mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API Escape form validation messages (SS-2013-008)
This commit is contained in:
parent
cbaa91ebd7
commit
a338e608b8
@ -155,6 +155,10 @@ class Form extends RequestHandler {
|
|||||||
'forTemplate',
|
'forTemplate',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private static $casting = array(
|
||||||
|
'Message' => 'Text'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new form, with the given fields an action buttons.
|
* Create a new form, with the given fields an action buttons.
|
||||||
*
|
*
|
||||||
@ -489,7 +493,7 @@ class Form extends RequestHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an error message to a field on this form. It will be saved into the session
|
* Add a plain text error message to a field on this form. It will be saved into the session
|
||||||
* and used the next time this form is displayed.
|
* and used the next time this form is displayed.
|
||||||
*/
|
*/
|
||||||
public function addErrorMessage($fieldName, $message, $messageType) {
|
public function addErrorMessage($fieldName, $message, $messageType) {
|
||||||
|
@ -93,6 +93,10 @@ class FormField extends RequestHandler {
|
|||||||
*/
|
*/
|
||||||
protected $attributes = array();
|
protected $attributes = array();
|
||||||
|
|
||||||
|
private static $casting = array(
|
||||||
|
'Message' => 'Text'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a fieldname and converts camelcase to spaced
|
* Takes a fieldname and converts camelcase to spaced
|
||||||
* words. Also resolves combined fieldnames with dot syntax
|
* words. Also resolves combined fieldnames with dot syntax
|
||||||
|
Loading…
x
Reference in New Issue
Block a user