odoo/odoo#205595

Created by fw-bot
Merged at 271d045f0f951c5c307bea94fff9c2e213a3d114

Statuses:

label
odoo-dev:master-17.0-point_of_sale-prevent-crash-with-problematic-chars-in-htmlToCanvas-jula-428836-fw
head
937139e6c3f2f46bbe061884c78c7c5264a9d510
merged
6 months ago by Julien Launois (jula)
odoo/odoo
17.0 #195004
saas-17.2 #196485
saas-17.4 #197134
18.0 #201240
saas-18.1 #204480
saas-18.2 #205573
saas-18.3
saas-18.4
19.0
master #205595

[FW][FIX] point_of_sale: fix crash with problematic chars in htmlToCanvas

Current behavior before commit:
Sometimes when a Worldline terminal makes a payment with Edenred or Sodexo, it creates a ticket with special ascii characters like 0x0E that are not supposed to be printed. Some of those characters make the createImage method throw an error with the onerror Event.

Description of the fix:
Added the sanitizeNodeText function to remove all problematic ascii characters that should not be printed anyway.
Added a test to make sure htmlToCanvas can handle all ascii characters without crashing.

opw-4322339

Forward-Port-Of: #204480
Forward-Port-Of: #195004