Skip to content

Conversation

@patchee500
Copy link

In https://github.com/ozean12/shopware6-payment-module/blob/4.0/src/Components/Checkout/Service/WidgetService.php#L240 there is logic to shorten the line item descriptions to 255 chars. However this logic is not taking into account utf-8 encoding and in some cases will lead to broken characters inside the description (e.g. when the 255th character is an Umlaut).

This would not be problematic on it's own, but the data is later transformed into JSON in order to be passed to the billie widget in the checkout (https://github.com/ozean12/shopware6-payment-module/blob/4.0/src/Resources/views/storefront/billie-payment/hidden-input-field.html.twig#L10). As the data is malformed, the json_encode returns false, which breaks the checkout as the widget can't be loaded properly.

I suggest using mb_substr instead. Seems to solve the problem just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant