mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX: fixed double escaping for titles on output while maintaning escaping of special characters.
This commit is contained in:
parent
a315343c39
commit
d080c15a49
@ -242,16 +242,22 @@ class EditableFormField extends DataObject {
|
|||||||
* @return TextField
|
* @return TextField
|
||||||
*/
|
*/
|
||||||
function TitleField() {
|
function TitleField() {
|
||||||
$field = new TextField('Title', _t('EditableFormField.ENTERQUESTION', 'Enter Question'), $this->Title);
|
//do not XML escape the title field here, because that would result in a recursive escaping of the escaped text on every save
|
||||||
|
$field = new TextField('Title', _t('EditableFormField.ENTERQUESTION', 'Enter Question'), $this->getField('Title'));
|
||||||
$field->setName($this->getFieldName('Title'));
|
$field->setName($this->getFieldName('Title'));
|
||||||
|
|
||||||
if(!$this->canEdit()) {
|
if(!$this->canEdit()) {
|
||||||
return $field->performReadonlyTransformation();
|
return $field->performReadonlyTransformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $field;
|
return $field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the Title for rendering in the front-end (with XML values escaped) */
|
||||||
|
function getTitle() {
|
||||||
|
return Convert::raw2att($this->getField('Title'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the base name for this form field in the
|
* Return the base name for this form field in the
|
||||||
* form builder. Optionally returns the name with the given field
|
* form builder. Optionally returns the name with the given field
|
||||||
|
Loading…
Reference in New Issue
Block a user