Permalink
Browse files

fix(mime): fall back to detection based on extension for octet-stream

fixes #7263
  • Loading branch information...
jdalsem committed Mar 29, 2016
1 parent 50721e5 commit 0b1f45396aa0f147a7ae6b957d61fbd2854f5d30
Showing with 5 additions and 0 deletions.
  1. +5 −0 engine/classes/Elgg/Filesystem/MimeTypeDetector.php
@@ -174,6 +174,11 @@ public function fixDetectionErrors($type, $extension) {
if ($type === "application/vnd.ms-office" && $extension === "ppt") {
return "application/vnd.ms-powerpoint";
}
+
+ // try extension detection as a fallback for octet-stream
+ if ($type === "application/octet-stream" && $this->use_extension && isset($this->extensions[$extension])) {
+ return $this->extensions[$extension];
+ }
return $type;
}

0 comments on commit 0b1f453

Please sign in to comment.