Removed escaping on custom fields in presenter (#7631)

This commit is contained in:
snipe 2019-12-03 17:42:13 -08:00 committed by GitHub
parent f0af750b0a
commit 2fbbe430b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,13 +258,17 @@ class AssetPresenter extends Presenter
$query->whereHas('models');
})->get();
// Note: We do not need to e() escape the field names here, as they are already escaped when
// they are presented in the blade view. If we escape them here, custom fields with quotes in their
// name can break the listings page. - snipe
foreach ($fields as $field) {
$layout[] = [
"field" => 'custom_fields.'.$field->convertUnicodeDbSlug(),
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => ($field->field_encrypted=='1') ?'<i class="fa fa-lock"></i> '.e($field->name) : e($field->name),
"title" => ($field->field_encrypted=='1') ?'<i class="fa fa-lock"></i> '.$field->name : $field->name,
"formatter" => "customFieldsFormatter"
];