mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Allow multi-line content in grid field cells
It’s amazing that this but has been present for 7 years, but there you go!
This commit is contained in:
parent
3224c9971b
commit
6ec02da577
@ -253,14 +253,14 @@ class GridFieldDataColumns implements GridField_ColumnProvider
|
|||||||
// If the value is an object, we do one of two things
|
// If the value is an object, we do one of two things
|
||||||
if (method_exists($value, 'Nice')) {
|
if (method_exists($value, 'Nice')) {
|
||||||
// If it has a "Nice" method, call that & make sure the result is safe
|
// If it has a "Nice" method, call that & make sure the result is safe
|
||||||
$value = Convert::raw2xml($value->Nice());
|
$value = nl2br(Convert::raw2xml($value->Nice()));
|
||||||
} else {
|
} else {
|
||||||
// Otherwise call forTemplate - the result of this should already be safe
|
// Otherwise call forTemplate - the result of this should already be safe
|
||||||
$value = $value->forTemplate();
|
$value = $value->forTemplate();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, just treat as a text string & make sure the result is safe
|
// Otherwise, just treat as a text string & make sure the result is safe
|
||||||
$value = Convert::raw2xml($value);
|
$value = nl2br(Convert::raw2xml($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
Loading…
Reference in New Issue
Block a user