fix for determine fileType

didn't work if the file didn't have a file extension but the path
contains a dot.
This commit is contained in:
Uwe Steinmann 2019-08-27 21:47:05 +02:00
parent 140926be96
commit 4145b67dd6

View File

@ -118,9 +118,9 @@ function import_folder($dirname, $folder, $setfiledate, $setfolderdate, $metadat
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimetype = finfo_file($finfo, $path);
$lastDotIndex = strrpos($path, ".");
$lastDotIndex = strrpos($name, ".");
if (is_bool($lastDotIndex) && !$lastDotIndex) $filetype = ".";
else $filetype = substr($path, $lastDotIndex);
else $filetype = substr($name, $lastDotIndex);
// echo $mimetype." - ".$filetype." - ".$path."\n";
if($res = $folder->addDocument($name, $comment, $expires, $user, $keywords,