diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 35fec9c230f16..e16cfa52d728c 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -9,6 +9,7 @@ namespace OC\Files\Type; +use finfo; use OCP\Files\IMimeTypeDetector; use OCP\IBinaryFinder; use OCP\ITempManager; diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index 3d555fbcef46c..84d3ff4d164f8 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -103,6 +103,11 @@ public function testDetectString(): void { $this->assertEquals($expected, $result); } + public function testDetectStringIcon(): void { + $result = $this->detection->detectString(file_get_contents(\OC::$SERVERROOT . '/tests/data/media/image.ico')); + $this->assertEquals('image/vnd.microsoft.icon', $result); + } + public static function dataMimeTypeCustom(): array { return [ ['123', 'foobar/123'],