aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php')
-rw-r--r--vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php b/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php
index 7466babb3..b07103db9 100644
--- a/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php
+++ b/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php
@@ -85,10 +85,12 @@ class GuessContentType extends DAV\ServerPlugin
*/
protected function getContentType($fileName)
{
- // Just grabbing the extension
- $extension = strtolower(substr($fileName, strrpos($fileName, '.') + 1));
- if (isset($this->extensionMap[$extension])) {
- return $this->extensionMap[$extension];
+ if (null !== $fileName) {
+ // Just grabbing the extension
+ $extension = strtolower(substr($fileName, strrpos($fileName, '.') + 1));
+ if (isset($this->extensionMap[$extension])) {
+ return $this->extensionMap[$extension];
+ }
}
return 'application/octet-stream';