Commit 7da8dc43 authored by Nigel McNie's avatar Nigel McNie
Browse files

Added check that HTTP_USER_AGENT is available when doing an MSIE check. An...

Added check that HTTP_USER_AGENT is available when doing an MSIE check. An error in the logs alerted me to this.
parent 0a839b8a
......@@ -64,7 +64,7 @@ function serve_file($path, $filename, $options=array()) {
session_write_close(); // unlock session during fileserving
$mimetype = get_mime_type($path);
if (!$mimetype || (!is_image_mime_type($mimetype) && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))) {
if (!$mimetype || (!is_image_mime_type($mimetype) && (isset($_SERVER['HTTP_USER_AGENT']) && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')))) {
$mimetype = 'application/forcedownload';
}
$lastmodified = filemtime($path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment