allow wildcard in mimetypes of converters

This commit is contained in:
Uwe Steinmann 2017-12-04 11:00:04 +01:00
parent 7bd625c8fb
commit 2a08a3bbaf

View File

@ -129,10 +129,17 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
if($version && !$nocontent) {
$path = $dms->contentDir . $version->getPath();
$content = '';
$fp = null;
$mimetype = $version->getMimeType();
$cmd = '';
$mimeparts = explode('/', $mimetype, 2);
if(isset($_convcmd[$mimetype])) {
$cmd = sprintf($_convcmd[$mimetype], $path);
} elseif(isset($_convcmd[$mimeparts[0].'/*'])) {
$cmd = sprintf($_convcmd[$mimetype], $path);
} elseif(isset($_convcmd['*'])) {
$cmd = sprintf($_convcmd[$mimetype], $path);
}
if($cmd) {
try {
$content = self::execWithTimeout($cmd, $timeout);
if($content) {