Skip to content

Commit

Permalink
fix file limit path option
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 20, 2019
1 parent f7075a2 commit 55f09b3
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -80,6 +80,10 @@ public static boolean canReadFile(File f) {
!f.getCanonicalPath().startsWith(new File(".").getCanonicalPath())) {
return false;
}
if (!CoreUtilities.toLowerCase(Settings.fileLimitPath()).equals("none")
&& !f.getCanonicalPath().startsWith(new File("./" + Settings.fileLimitPath()).getCanonicalPath())) {
return false;
}
return true;
}
catch (Exception ex) {
Expand Down Expand Up @@ -125,6 +129,7 @@ public static boolean canWriteToFile(File f) {
}
if (!CoreUtilities.toLowerCase(Settings.fileLimitPath()).equals("none")
&& !f.getCanonicalPath().startsWith(new File("./" + Settings.fileLimitPath()).getCanonicalPath())) {
return false;
}
return isFileCanonicalStringSafeToWrite(lown) && isFileCanonicalStringSafeToWrite(lown + "/");
}
Expand Down

0 comments on commit 55f09b3

Please sign in to comment.