From 2cc8c0d95505bef8013aea404c69c4c36eee1e3b Mon Sep 17 00:00:00 2001 From: mustofa binary Date: Wed, 27 Nov 2019 17:35:07 +0800 Subject: [PATCH 1/3] sanitize directly and add ; --- src/common/rivetsExtra.es6 | 4 +++- src/workspace/workspace.es6 | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/rivetsExtra.es6 b/src/common/rivetsExtra.es6 index 4b0a0ec18c..df4e32ad22 100644 --- a/src/common/rivetsExtra.es6 +++ b/src/common/rivetsExtra.es6 @@ -29,7 +29,9 @@ rv.formatters['i18n'] = (value) => { if (typeof value === 'string') return value.i18n(); return value; }; -rv.formatters['sanitize'] = (value) => value.replace(/("|'|\&|\(|\)|\<|\>)/g, ''); +rv.formatters['sanitize'] = (value) => { + return value.replace(/("|'|\&|\(|\)|\<|\>|\;)/g, ''); +} /* rivets formatter to get the property value of an object */ rv.formatters['prop'] = (value, prop) => { return value && value[prop]; diff --git a/src/workspace/workspace.es6 b/src/workspace/workspace.es6 index 6a65ec2c8b..ed9b982a06 100644 --- a/src/workspace/workspace.es6 +++ b/src/workspace/workspace.es6 @@ -20,7 +20,7 @@ const INITIAL_WORKSPACE_NAME = 'my-workspace-1'; const clone = obj => JSON.parse(JSON.stringify(obj)); -const sanitize = value => value.replace(/("|'|\&|\(|\)|\<|\>)/g, ''); +const sanitize = value => value.replace(/("|'|\&|\(|\)|\<|\>|\;)/g, ''); const state = { route: 'active', // one of ['active', 'saved', 'rename', 'saveas'] @@ -213,7 +213,7 @@ const state = { const {name} = w; const inx = _.findIndex(state.workspaces, {name: name}); const workspace = inx !== -1 ? state.workspaces[inx] : local_storage.get('states'); - workspace.name = name; + workspace.name = sanitize(name); workspace.template_type = 'workspace-template'; workspace.random = state.file.hash_code(workspace) var json = JSON.stringify(workspace); From 3abc48c94ceb7ac54b3f2e1ebd159c8815726837 Mon Sep 17 00:00:00 2001 From: mustofa binary Date: Thu, 28 Nov 2019 13:16:54 +0800 Subject: [PATCH 2/3] single line --- src/common/rivetsExtra.es6 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/rivetsExtra.es6 b/src/common/rivetsExtra.es6 index df4e32ad22..8ec8b792ac 100644 --- a/src/common/rivetsExtra.es6 +++ b/src/common/rivetsExtra.es6 @@ -29,9 +29,7 @@ rv.formatters['i18n'] = (value) => { if (typeof value === 'string') return value.i18n(); return value; }; -rv.formatters['sanitize'] = (value) => { - return value.replace(/("|'|\&|\(|\)|\<|\>|\;)/g, ''); -} +rv.formatters['sanitize'] = (value) => value.replace(/("|'|\&|\(|\)|\<|\>|\;)/g, ''); /* rivets formatter to get the property value of an object */ rv.formatters['prop'] = (value, prop) => { return value && value[prop]; From 3b0953421aa8e17c1548530ead0aac8665bcf02a Mon Sep 17 00:00:00 2001 From: mustofa binary Date: Thu, 28 Nov 2019 14:14:21 +0800 Subject: [PATCH 3/3] add home html to register free account --- src/oauth/login.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oauth/login.es6 b/src/oauth/login.es6 index 074f12d47d..61a4b2da28 100644 --- a/src/oauth/login.es6 +++ b/src/oauth/login.es6 @@ -68,7 +68,7 @@ const init_state = (root, win) => { login(); }, onRegister: () => { - const register_link = getBinaryUrl('home'); + const register_link = getBinaryUrl('home.html'); window.open(register_link, '_blank'); }, };