summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/transcoder.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-11-13 16:57:40 +0100
committerNicolas Lempereur <nle@odoo.com>2016-01-06 15:31:03 +0100
commitdccecaf11f575db1f9b58ee1df334cd89bdd8479 (patch)
treeb0550447f69466aad1d099713d26f69d35f10438 /addons/web_editor/static/src/js/transcoder.js
parente6c35bc4de034fe420c8b6d3d602464210d52201 (diff)
[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
Diffstat (limited to 'addons/web_editor/static/src/js/transcoder.js')
-rw-r--r--addons/web_editor/static/src/js/transcoder.js2
1 files changed, 1 insertions, 1 deletions
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 = $("<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