mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02:00
averify that the path is not a folder
This commit is contained in:
@@ -337,6 +337,9 @@ module.exports.isFilePathValid = async (options) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (ofs.existsSync(anonymizedFilePath)) {
|
if (ofs.existsSync(anonymizedFilePath)) {
|
||||||
|
if (fs.lstatSync(anonymizedFilePath).isDirectory()) {
|
||||||
|
throw "is_folder";
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,6 +370,9 @@ module.exports.isFilePathValid = async (options) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (ofs.existsSync(originalFilePath)) {
|
if (ofs.existsSync(originalFilePath)) {
|
||||||
|
if (fs.lstatSync(originalFilePath).isDirectory()) {
|
||||||
|
throw "is_folder";
|
||||||
|
}
|
||||||
if (!module.exports.isFileSupported(repoConfig, originalFilePath)) {
|
if (!module.exports.isFileSupported(repoConfig, originalFilePath)) {
|
||||||
throw "file_not_supported";
|
throw "file_not_supported";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user