odoo/odoo#197134

Created by fw-bot
Merged at f007669e717a6dab42953c3867610f27b9a5e146

Statuses:

label
odoo-dev:saas-17.4-17.0-point_of_sale-prevent-crash-with-problematic-chars-in-htmlToCanvas-jula-411618-fw
head
46ce104d50fa952c8a4071b4891e973794ba8818
merged
7 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: #195004