Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Big long recursive directories org-ids/web-ide-issues#969
  • Loading branch information
squarti committed Feb 12, 2018
1 parent 23f644f commit 557a906
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/orionode/lib/fileUtil.js
Expand Up @@ -519,6 +519,9 @@ exports.handleFilePOST = function(workspaceRoot, fileRoot, req, res, destFile, m
var project = {};
if (isNonWrite) {
var sourceFile = getFile(req, api.decodeURIComponent(sourceUrl.replace(new RegExp("^"+fileRoot), "")));
if (path.resolve(destFile.path).indexOf(path.resolve(sourceFile.path)) === 0) {
return api.writeError(400, res, "The destination cannot be a descendent of the source location");
}
return fs.stat(sourceFile.path, function(err, stats) {
if(err) {
if (err.code === 'ENOENT') {
Expand Down

0 comments on commit 557a906

Please sign in to comment.