Improve uploaded file security by adding .htfile prefix to filename
This commit is contained in:
parent
1cc06d6a10
commit
fe9e2f3632
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ class AdminerFileUpload {
|
|||
mkdir(__DIR__ . '/' . $this->uploadPath . '/' . $table);
|
||||
}
|
||||
// generate filename
|
||||
$filename = realpath(tempnam(__DIR__ . '/' . $this->uploadPath . '/' . $table, ''));
|
||||
$filename = realpath(tempnam(__DIR__ . '/' . $this->uploadPath . '/' . $table, '.htfile'));
|
||||
|
||||
// prevent the final to be anywhere else then under the upload directory
|
||||
if (strpos($filename, realpath(__DIR__ . '/' . $this->uploadPath)) !== 0) {
|
||||
|
|
Loading…
Reference in a new issue