buffer($content) ?: 'application/octet-stream'; if (in_array($mime, $this->safeMimes)) { return $mime; } [$category] = explode('/', $mime, 2); if ($category === 'text') { return 'text/plain'; } return 'application/octet-stream'; } }