API Escape form validation messages (SS-2013-008)

This commit is contained in:
Ingo Schommer 2013-09-24 13:58:32 +02:00
parent 114fb59107
commit c243418597
2 changed files with 16 additions and 8 deletions

View File

@ -144,6 +144,10 @@ class Form extends RequestHandler {
*/
protected $attributes = array();
public static $casting = array(
'Message' => 'Text'
);
/**
* Create a new form, with the given fields an action buttons.
*
@ -439,7 +443,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.
*/
public function addErrorMessage($fieldName, $message, $messageType) {

View File

@ -93,6 +93,10 @@ class FormField extends RequestHandler {
*/
protected $attributes = array();
public static $casting = array(
'Message' => 'Text'
);
/**
* Takes a fieldname and converts camelcase to spaced
* words. Also resolves combined fieldnames with dot syntax