mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-01-18 04:59:16 +02:00
[Web] Fix resource.php and /cache/ warning message
If http://mail.example.tld/cache/ or http://mail.example.tld/resource.php are called without the required parameters it returns one or two warnings
This commit is contained in:
parent
161130c116
commit
deac5ad2fe
@ -1,6 +1,15 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_GET['file']) ) {
|
||||
http_response_code(404);
|
||||
exit;
|
||||
}
|
||||
$pathinfo = pathinfo($_GET['file']);
|
||||
|
||||
if (!array_key_exists('extension', $pathinfo)) {
|
||||
http_response_code(404);
|
||||
exit;
|
||||
}
|
||||
$extension = strtolower($pathinfo['extension']);
|
||||
|
||||
$filepath = '/tmp/' . $pathinfo['basename'];
|
||||
|
Loading…
Reference in New Issue
Block a user