Skip to content
Permalink
Browse files

Added detection for vsd files

  • Loading branch information...
SoftCreatR committed Nov 5, 2018
1 parent 1911a01 commit e1849630142290efb83e61d91a33e4d48e0ab9c4
@@ -786,6 +786,18 @@ public function getFileType(): array
}
if ($this->checkForBytes([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) {
// MS Visio
if ($this->checkForBytes([
0x56, 0x00, 0x69, 0x00, 0x73,
0x00, 0x69, 0x00, 0x6F, 0x00,
0x44, 0x00, 0x6F, 0x00, 0x63
], 1664)) {
return [
'ext' => 'vsd',
'mime' => 'application/vnd.visio'
];
}
return [
'ext' => 'msi',
'mime' => 'application/x-msi'
@@ -937,7 +949,7 @@ public function getFileType(): array
'mime' => 'audio/basic'
];
}
// unfortunately, these formats don't have a proper mime type, but they are worth detecting
if ($this->checkForBytes([0x67, 0x33, 0x64, 0x72, 0x65, 0x6D])) {
return [
@@ -394,7 +394,7 @@ public function provideTestFiles(): array
$files[$file->getBasename()] = [
'file' => $file->getPathname(),
'hash' => $this->getInstance()->getHash($file->getPathname()),
'ext' => $file->getExtension()
'ext' => strtolower($file->getExtension())
];
}
}
@@ -420,7 +420,7 @@ public function provideSingleTestFile(): array
$fileInfo = [
'file' => $file->getPathname(),
'hash' => $this->getInstance()->getHash($file->getPathname()),
'ext' => $file->getExtension()
'ext' => strtolower($file->getExtension())
];
}
}
Submodule fixtures updated 1 files
+ fixture.vsd

0 comments on commit e184963

Please sign in to comment.
You can’t perform that action at this time.