mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Auto-escape titles in TreeDropdownField
Related to SS-2013-009. While the default "TreeTitle" was escaped within the SiteTree->TreeTitle() getter, other properties like SiteTree->Title weren't escaped. The new logic uses the underlying casting helpers on the processed objects.
This commit is contained in:
parent
81ccb8d78e
commit
f69161efef
@ -233,8 +233,14 @@ class TreeDropdownField extends FormField {
|
||||
}
|
||||
}
|
||||
|
||||
if($obj->escapeTypeForField($this->labelField) == 'xml') {
|
||||
$labelFieldEval = '$child->' . $this->labelField;
|
||||
} else {
|
||||
$labelFieldEval = 'Convert::raw2xml($child->' . $this->labelField . ')';
|
||||
}
|
||||
|
||||
$eval = '"<li id=\"selector-' . $this->Name() . '-{$child->' . $this->keyField . '}\" class=\"$child->class"' .
|
||||
' . $child->markingClasses() . "\"><a rel=\"$child->ID\">" . $child->' . $this->labelField . ' . "</a>"';
|
||||
' . $child->markingClasses() . "\"><a rel=\"$child->ID\">" . ' . $labelFieldEval . ' . "</a>"';
|
||||
|
||||
if($isSubTree) {
|
||||
return substr(trim($obj->getChildrenAsUL('', $eval, null, true)), 4, -5);
|
||||
|
Loading…
x
Reference in New Issue
Block a user