Merge pull request #9165 from sminnee/fix-multiline-gridfield

FIX: Allow multi-line content in grid field cells
This commit is contained in:
Robbie Averill 2019-08-05 09:59:22 +12:00 committed by GitHub
commit 4268db069d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -253,14 +253,14 @@ class GridFieldDataColumns implements GridField_ColumnProvider
// If the value is an object, we do one of two things
if (method_exists($value, 'Nice')) {
// 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 {
// Otherwise call forTemplate - the result of this should already be safe
$value = $value->forTemplate();
}
} else {
// Otherwise, just treat as a text string & make sure the result is safe
$value = Convert::raw2xml($value);
$value = nl2br(Convert::raw2xml($value));
}
return $value;