We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f05a32f commit f60e62eCopy full SHA for f60e62e
phpserver/router.php
@@ -47,7 +47,8 @@
47
$path = pathinfo($_SERVER["SCRIPT_FILENAME"]);
48
$url = pathinfo(substr($_SERVER["REQUEST_URI"], 1));
49
$route = parse_url(substr($_SERVER["REQUEST_URI"], 1))["path"];
50
- $ext = @pathinfo($route)['extension'];
+ $pathinfo = pathinfo($route);
51
+ $ext = isset($pathinfo['extension']) ? $pathinfo['extension'] : '';
52
53
if ($path["basename"] == 'favicon.ico') {
54
return false;
@@ -95,7 +96,7 @@
95
96
'html' => 'text/html',
97
];
98
- $type = @$mimeTypes[$ext];
99
+ $type = isset($mimeTypes[$ext]) && $mimeTypes[$ext];
100
if ($type) {
101
header("Content-Type: $type");
102
}
0 commit comments