1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

Fixed: Folder in OPDS stay be visible when supportedExtensions is configured

This commit is contained in:
Alexander Yamshanov 2016-07-04 23:28:04 +06:00
parent 2a62589537
commit 26bd6b7d79

View file

@ -47,16 +47,18 @@ class Files extends \OCA\Files\Helper
/* if set, add only files with given extensions */
$fileTypes = array_filter(explode(',', strtolower(Config::get('file_types', ''))));
$skipList = array_filter(explode(',', strtolower(Config::get('skip_list', 'metadata.opf,cover.jpg'))));
foreach ($fileInfos as $i) {
if((!empty($fileTypes)) && (!in_array(strtolower(substr(strrchr($i->getName(), "."), 1)), $fileTypes))) {
continue;
}
if((!empty($skipList)) && (in_array($i->getName(),$skipList))) {
continue;
foreach ($fileInfos as $i) {
if (strcmp($i->getType(), 'dir') !== 0) {
if ((!empty($fileTypes)) && (!in_array(strtolower(substr(strrchr($i->getName(), "."), 1)), $fileTypes))) {
continue;
}
if ((!empty($skipList)) && (in_array($i->getName(), $skipList))) {
continue;
}
}
$files[] = self::formatFileInfo($i);
}
$files[] = self::formatFileInfo($i);
}
return $files;
}