summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Files/Type/Detection.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php
index e8825037666..34caf072d98 100644
--- a/lib/private/Files/Type/Detection.php
+++ b/lib/private/Files/Type/Detection.php
@@ -373,12 +373,15 @@ class Detection implements IMimeTypeDetector {
}
// Try only the first part of the filetype
- $mimePart = substr($icon, 0, strpos($icon, '-'));
- try {
- $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $mimePart . '.svg');
- return $this->mimetypeIcons[$mimetype];
- } catch (\RuntimeException $e) {
- // Image for the first part of the mimetype not found
+
+ if(strpos($icon, '-')) {
+ $mimePart = substr($icon, 0, strpos($icon, '-'));
+ try {
+ $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $mimePart . '.svg');
+ return $this->mimetypeIcons[$mimetype];
+ } catch (\RuntimeException $e) {
+ // Image for the first part of the mimetype not found
+ }
}
$this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/file.svg');