Skip to content

Commit

Permalink
use standard function for mime detection see #5289
Browse files Browse the repository at this point in the history
  • Loading branch information
moyooo committed Jun 1, 2015
1 parent bacbca5 commit b9f93ce
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions inc/document.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -987,14 +987,7 @@ static function moveDocument(array &$input, $filename) {
}

// Local file : try to detect mime type
if (function_exists('finfo_open')
&& ($finfo = finfo_open(FILEINFO_MIME))) {
$input['mime'] = finfo_file($finfo, $fullpath);
finfo_close($finfo);

} else if (function_exists('mime_content_type')) {
$input['mime'] = mime_content_type($fullpath);
}
$input['mime'] = Toolbox::getMime($fullpath);

if (is_writable(GLPI_TMP_DIR)
&& is_writable ($fullpath)) { // Move if allowed
Expand Down

0 comments on commit b9f93ce

Please sign in to comment.