Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Finding an arbitrary file upload vulnerability in a filesharing script.
..... WHAT?
Python has a suite of facilities exactly for this very kind of problem.
Literally, the solution is "os.path.abspath(filename).startswith(os.path.abspath(dlfolder))"
This should, in all cases, return true if the filename is within the download folder directory, and false for any other case.
..... WHAT?
Python has a suite of facilities exactly for this very kind of problem.
Literally, the solution is "os.path.abspath(filename).startswith(os.path.abspath(dlfolder))"
This should, in all cases, return true if the filename is within the download folder directory, and false for any other case.