anarchoi;11029953 wrote:Ok but correct me if i am wrong but even if a malicious user use the function to search for a ssh file, the script will only return the path of the file... He won't be able to download it.
(sorry, I edited my original post before I saw your reply and this question.)
even if the link is malformed, you're still revealing info about your system that you shouldn't be.
anarchoi;11029953 wrote:The post and the link doesn't say if it will scan the sub-folders and sub-subfolders...
php.net wrote:The glob() function searches for all the pathnames matching $pattern [emphasis added] according to the rules used by the libc glob() function, which is similar to the rules used by common shells.
So, if you start with [font=monospace] //filename.ext [/font] (the matches all characters), then yes, you'll search the entire system. Kinda wasteful to search your entire HD when you know that most paths won't be usable, even if they do match the filename. It makes much more sense to limit your search to the path(s) that hold your downloadable files.