mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Merge pull request #506 from Flatta/fix-sec-backup
Fix #505: Strict backup filename check.
This commit is contained in:
commit
4dce22cd77
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
}
|
||||
|
||||
if ((!empty($_SESSION['user'])) && ($_SESSION['user'] != 'admin')) {
|
||||
if (preg_match("/^".$user."/i", $backup)) {
|
||||
if (strpos($backup, $user.'.') === 0) {
|
||||
header('Content-type: application/gzip');
|
||||
header("Content-Disposition: attachment; filename=\"".$backup."\";" );
|
||||
header("X-Accel-Redirect: /backup/" . $backup);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue