From 716ceede16a810e09c9d53f7f641826a34d276eb Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 20 Apr 2017 12:29:47 +0200 Subject: [PATCH] [FIX] web_enterprise: kanban_state_selection ie On IE (from 9.0 up to at least IE EDGE 14) we have this behavior for the method serializeToString of XMLSerializer: > (new XMLSerializer()).serializeToString($('"')[0]) '"' > (new XMLSerializer()).serializeToString($('"')[0].firstChild) '"' Whilst browser such as chromium or firefox have: > (new XMLSerializer()).serializeToString($('"')[0]) '"' > (new XMLSerializer()).serializeToString($('"')[0].firstChild) '"' Hence for IE9 and over, if in a `` a `t-jquery` sub-directive (without `t-operation`) is available, we can have broken javascript if a " is transformed into an " at a unfortunate location. This commit favour node.data over XMLSerializer serializeToString to avoid the possibility of this issue when a text node is processed. opw-727283 --- addons/web/static/lib/qweb/qweb2.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 92139b3c483..6ca59e8d525 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -120,12 +120,15 @@ var QWeb2 = { } return r.join(''); } else { + // avoid XMLSerializer with text node for IE + if (node.nodeType == 3) { + return node.data; + } if (typeof XMLSerializer !== 'undefined') { return (new XMLSerializer()).serializeToString(node); } else { switch(node.nodeType) { case 1: return node.outerHTML; - case 3: return node.data; case 4: return ''; case 8: return ''; }