mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(cloudfunc) encodeEntities: add "<", ">"
This commit is contained in:
parent
28f0283cab
commit
a586640e8d
1 changed files with 8 additions and 3 deletions
|
|
@ -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, '<')
|
||||
.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
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue