odoo/odoo#205573

Created by fw-bot
Merged at 3f4d44f9517779263d9eb84358950b928e1dbcba

Statuses:

label
odoo-dev:saas-18.2-17.0-point_of_sale-prevent-crash-with-problematic-chars-in-htmlToCanvas-jula-427208-fw
head
46d2e7f9082d1fed410f6fb3d158d7f9d2aebe37
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