From dccecaf11f575db1f9b58ee1df334cd89bdd8479 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 13 Nov 2015 16:57:40 +0100 Subject: [IMP] web_editor: use unicode number for FontAwesome controller In some non-usual circumstances, using unicode in controllers can lead to issue. For example on a terminal using C encoding (instead of the mighty UTF-8) werkzeug might use sys.getfilesystemencoding to encode the request URL which will fail with UTF-8 inside. This commit change the URL character of the font awesome controller to UTF-8, but keep the old way since every sent mail might still use it. There is the overlap of character 0 to 9 which are overidden in this commit by unicode code 0 to 9, but these were not used in font-awesome anyway (or these are not even visible ASCII characters). closes #9572 --- addons/web_editor/static/src/js/transcoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js/transcoder.js') diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index bd7848d2e97..4fd512f883a 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -107,7 +107,7 @@ var font_to_img = function ($editable) { }); if (content) { var color = $font.css("color").replace(/\s/g, ''); - var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+$font.height(), window.encodeURI(content), window.encodeURI(color)); + var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+$font.height(), content.charCodeAt(0), window.encodeURI(color)); var $img = $("").attr("src", src) .attr("data-class", $font.attr("class")) .attr("class", $font.attr("class").replace(new RegExp("(^|\\s+)" + icon + "(-[^\\s]+)?", "gi"), '')) // remove inline font-awsome style -- cgit v1.2.3