From 52f41017d1e3181d643d61cbd692bde7b1215b00 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 26 Dec 2014 10:50:23 -0500 Subject: [PATCH] fix(cloudfunc) encode space before render: " " -> " " --- lib/cloudfunc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 71f420d1..0b5be258 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -34,6 +34,10 @@ var Util; this.CHANNEL_TERMINAL_RESIZE= 'terminal-resize'; this.MAX_FILE_SIZE = 500 * 1024; + function encodeSpace(str) { + return str.replace(/\s/g, ' '); + } + this.formatMsg = function(msg, name, status) { if (!status) status = 'ok'; @@ -223,7 +227,7 @@ var Util; linkResult = render(templateLink, { link : link, - name : file.name, + name : encodeSpace(file.name), attribute : attribute });