From ab1b36725585b9247b5d33787749a19ad8a6fad1 Mon Sep 17 00:00:00 2001 From: Shankar Date: Thu, 30 Nov 2017 20:07:35 +0530 Subject: [PATCH] fix/whm_path_seperator: resolve path separator issue (#328) Resolved path separator issue on upload --- web_hosting_manager/app/safenet_comm/helpers/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_hosting_manager/app/safenet_comm/helpers/utils.js b/web_hosting_manager/app/safenet_comm/helpers/utils.js index 078f4b1..653fe6d 100644 --- a/web_hosting_manager/app/safenet_comm/helpers/utils.js +++ b/web_hosting_manager/app/safenet_comm/helpers/utils.js @@ -20,7 +20,11 @@ export const parseNetworkPath = (nwPath) => { file: undefined, }; if (nwPath) { - const sep = path.sep; + const sep = '/'; + if (path.sep === '\\') { + const regx = new RegExp(/\\/,'g'); + nwPath = nwPath.replace(regx, sep); + } const splitPath = nwPath.split(sep); result.dir = splitPath.slice(0, 3).join(sep); result.file = splitPath.slice(3).join(sep) || path.basename(nwPath);