mirror of
https://tildegit.org/sbgodin/HtmGem.git
synced 2023-08-25 13:53:12 +02:00
FIX empty 404 and source file access
An empty existing file triggered 404 error. It was possible to get the source of any file (including .php).
This commit is contained in:
parent
087c2b5e6c
commit
b2e09c54f5
@ -53,7 +53,7 @@ $fileContents = @file_get_contents($filePath);
|
||||
|
||||
|
||||
######################################## 404 page
|
||||
if (empty($fileContents)) {
|
||||
if (!file_exists($filePath) || !preg_match("/\.gmi$/", $url)) {
|
||||
error_log("HtmGem: 404 $url $filePath");
|
||||
http_response_code(404); ?>
|
||||
<!DOCTYPE html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user