Permalink
Browse files

Ensure the file exists before running finfo

  • Loading branch information...
1 parent 6605368 commit b2651aa849a1969a1817e62413c474126096bde1 @kolber committed Feb 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/asset-types/asset.inc.php
View
2 app/asset-types/asset.inc.php
@@ -29,7 +29,7 @@ function set_default_data($file_path) {
$this->data['file_name'] = $this->file_name;
$this->data['name'] = ucfirst(preg_replace(array('/[-_]/', '/\.[\w\d]+?$/', '/^\d+?\./'), array(' ', '', ''), $this->file_name));
- if (class_exists('finfo')) {
+ if (class_exists('finfo') && file_exists($file_path)) {
$finfo = new finfo(FILEINFO_MIME_TYPE);
if ($finfo) {
$this->data['mime_type'] = $finfo->file($file_path);

0 comments on commit b2651aa

Please sign in to comment.