mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
use pathinfo() to extract file extension
This commit is contained in:
parent
1ef5cb0444
commit
e803c4d657
|
@ -149,9 +149,7 @@ if(is_readable($filename)) {
|
|||
if(!$mimetype) {
|
||||
$mimetype = $finfo->file($filename);
|
||||
}
|
||||
$lastDotIndex = strrpos(basename($filename), ".");
|
||||
if (is_bool($lastDotIndex) && !$lastDotIndex) $filetype = ".";
|
||||
else $filetype = substr($filename, $lastDotIndex);
|
||||
$filetype = "." . pathinfo($filename, PATHINFO_EXTENSION);
|
||||
} else {
|
||||
echo "File has zero size\n";
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue
Block a user