public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[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
deac5ad2
data/web/resource.php | 9 +++++++++
1 file changed, 9 insertions(+)
Diff
diff --git a/data/web/resource.php b/data/web/resource.php
index 96d41c1a..1f35afa3 100644
--- a/data/web/resource.php
+++ b/data/web/resource.php
@@ -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'];