mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 07:22:34 +00:00
update
This commit is contained in:
@@ -880,20 +880,18 @@ export const Utils = {
|
||||
return password;
|
||||
},
|
||||
|
||||
pathNormalize: function(filePath, relativePath) {
|
||||
let newPath = relativePath.split('/');
|
||||
let path = filePath.slice(1, filePath.lastIndexOf('/')).split('/');
|
||||
for (let i = 0, len = newPath.length; i < len; i++) {
|
||||
if (newPath[i] === '..') {
|
||||
path.pop();
|
||||
newPath.splice(i, 1);
|
||||
i--;
|
||||
} else if (newPath[i] === '.') {
|
||||
pathNormalize: function(originalPath) {
|
||||
let newPath = originalPath.split('/');
|
||||
for (let i = 0; i < newPath.length; i++) {
|
||||
if (newPath[i] === '.' || newPath[i] === '') {
|
||||
newPath.splice(i, 1);
|
||||
i--;
|
||||
} else if (newPath[i] === '..') {
|
||||
newPath.splice(i - 1, 2);
|
||||
i = i - 2;
|
||||
}
|
||||
}
|
||||
return path.concat(newPath).join('/');
|
||||
return newPath.join('/');
|
||||
},
|
||||
|
||||
getEventData: function(event, data) {
|
||||
|
Reference in New Issue
Block a user