Continued a bit:

- added spaces/curly braces
- used x($foo, 'bar') instead of isset($foo['bar'])
- let's wrap html_entity_encode() somehow

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-04-05 22:30:12 +02:00
commit 28c08467fd
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
2 changed files with 35 additions and 28 deletions

View file

@ -1060,13 +1060,14 @@ function z_mime_content_type($filename) {
'zsh' => 'text/x-script.zsh',
);
$dot = strpos($filename,'.');
$dot = strpos($filename, '.');
if ($dot !== false) {
$ext = strtolower(substr($filename,$dot+1));
$ext = strtolower(substr($filename, $dot + 1));
if (array_key_exists($ext, $mime_types)) {
return $mime_types[$ext];
}
}
/// @TODO Then let's get rid of it?
// can't use this because we're just passing a name, e.g. not a file that can be opened
// elseif (function_exists('finfo_open')) {
// $finfo = @finfo_open(FILEINFO_MIME);