public function fixDetectionErrors($type, $extension)
{
if ($type === 'application/zip') {
// hack for Microsoft zipped formats
switch ($extension) {
case 'docx':
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
case 'xlsx':
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
case 'pptx':
return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
}
}
// check for bad ppt detection
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;
}