Skip to content

Commit

Permalink
ASW-486 remove santizing on name and description as well
Browse files Browse the repository at this point in the history
  • Loading branch information
davemeteor committed Apr 11, 2022
1 parent 908e2bd commit d11ca53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Shopware/Serializer/SwPaymentMeanSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@

use AdyenPayment\Models\Payment\PaymentMean;
use AdyenPayment\Serializer\PaymentMeanSerializer;
use AdyenPayment\Utils\Sanitize;

final class SwPaymentMeanSerializer implements PaymentMeanSerializer
{
public function __invoke(PaymentMean $paymentMean): array
{
return [
$paymentMean->getId() => array_replace($paymentMean->getRaw(), [
'name' => Sanitize::escape($paymentMean->getValue('name')),
'description' => Sanitize::escape($paymentMean->getValue('description')),
'name' => $paymentMean->getValue('name'),
'description' => $paymentMean->getValue('description'),
'additionaldescription' => $paymentMean->getValue('additionaldescription'),
]),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public function it_can_serialize_html(): void
$id => [
'id' => $id,
'source' => $source,
'name' => '<some-tag> a name</some-tag> "quoted"',
'description' => "description and<a href='test'>a link</a>",
'name' => '<some-tag> a name</some-tag> "quoted"',
'description' => "description and<a href='test'>a link</a>",
'additionaldescription' => "additional <div>a div</div> and <a href='test'>link</a>",
],
], $result);
Expand Down

0 comments on commit d11ca53

Please sign in to comment.