FIX Escaping in "dependent pages" (SS-2013-009)

This commit is contained in:
Ingo Schommer 2013-09-24 12:12:21 +02:00
parent 79996a76fe
commit e170f4c21b

View File

@ -1827,8 +1827,20 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
); );
$dependentTable->getConfig()->getComponentByType('GridFieldDataColumns') $dependentTable->getConfig()->getComponentByType('GridFieldDataColumns')
->setFieldFormatting(array( ->setFieldFormatting(array(
'Title' => '<a href=\"admin/pages/edit/show/$ID\">$Title</a>', 'Title' => function($value, &$item) {
'AbsoluteLink' => '<a href=\"$value\">$value</a>', return sprintf(
'<a href=\"admin/pages/edit/show/%d\">%s</a>',
(int)$item->ID,
Convert::raw2xml($item->Title)
);
},
'AbsoluteLink' => function($value, &$item) {
return sprintf(
'<a href=\"%s\">%s</a>',
Convert::raw2xml($value),
Convert::raw2xml($value)
);
}
)); ));
} }