Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10315 from snipe/fixes/escape_custom_fields_in_ap…
…i_response

Escape custom field values in API response
  • Loading branch information
snipe committed Nov 16, 2021
2 parents e75a5f1 + f7b4833 commit 7ce5993
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Http/Transformers/AssetsTransformer.php
Expand Up @@ -93,15 +93,15 @@ public function transformAsset(Asset $asset)
$value = (Gate::allows('superadmin')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));

$fields_array[$field->name] = [
'field' => $field->convertUnicodeDbSlug(),
'value' => $value,
'field' => e($field->convertUnicodeDbSlug()),
'value' => e($value),
'field_format' => $field->format,
];

} else {
$fields_array[$field->name] = [
'field' => $field->convertUnicodeDbSlug(),
'value' => $asset->{$field->convertUnicodeDbSlug()},
'field' => e($field->convertUnicodeDbSlug()),
'value' => e($asset->{$field->convertUnicodeDbSlug()}),
'field_format' => $field->format,
];

Expand Down Expand Up @@ -134,7 +134,7 @@ public function transformAsset(Asset $asset)

'id' => $component->id,
'pivot_id' => $component->pivot->id,
'name' => $component->name,
'name' => e($component->name),
'qty' => $component->pivot->assigned_qty,
'price_cost' => $component->purchase_cost,
'purchase_total' => $component->purchase_cost * $component->pivot->assigned_qty,
Expand Down

0 comments on commit 7ce5993

Please sign in to comment.