Skip to content

Commit 530cf61

Browse files
committed
download: Use PSR-2 coding style
Signed-off-by: Stefan Weil <[email protected]>
1 parent 8ce2b68 commit 530cf61

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

download.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
// a valid request has to contain a file to be downloaded
99
if (!isset($_GET['file']) || empty($_GET['file'])) {
10-
header('Bad Request', true, 400);
11-
exit();
10+
header('Bad Request', true, 400);
11+
exit();
1212
}
1313

1414
// avoid directory traversal vulnerability
@@ -20,12 +20,12 @@
2020
$filepath = CONFIG_UPLOAD_DIR . '/' . $filename;
2121

2222
if (file_exists($filepath)) {
23-
// file exists: return file for download
24-
header('Content-Type: application/octet-stream');
25-
header('Content-Disposition: attachment; filename="'.addslashes($filename).'"');
26-
readfile($filepath);
23+
// file exists: return file for download
24+
header('Content-Type: application/octet-stream');
25+
header('Content-Disposition: attachment; filename="'.addslashes($filename).'"');
26+
readfile($filepath);
2727
} else {
28-
// file does not exist: 404 Not Found
29-
header('Not Found', true, 404);
30-
exit();
28+
// file does not exist: 404 Not Found
29+
header('Not Found', true, 404);
30+
exit();
3131
}

0 commit comments

Comments
 (0)