From a586640e8d171e97ee395c2684afa7b5ebe0d9c3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 29 Dec 2014 06:49:54 -0500 Subject: [PATCH] fix(cloudfunc) encodeEntities: add "<", ">" --- lib/cloudfunc.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 0b5be258..32aee1e3 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -34,8 +34,13 @@ var Util; this.CHANNEL_TERMINAL_RESIZE= 'terminal-resize'; this.MAX_FILE_SIZE = 500 * 1024; - function encodeSpace(str) { - return str.replace(/\s/g, ' '); + function encodeEntities(str) { + str = str + .replace(/\s/g, ' ') + .replace(//g, '>'); + + return str; } this.formatMsg = function(msg, name, status) { @@ -227,7 +232,7 @@ var Util; linkResult = render(templateLink, { link : link, - name : encodeSpace(file.name), + name : encodeEntities(file.name), attribute : attribute });