|
|
|
@ -108,12 +108,12 @@ Class ListController extends Controller {
@@ -108,12 +108,12 @@ Class ListController extends Controller {
|
|
|
|
|
if ($showType == 'image' && !empty($scanResults[$cateId]['files'])) { |
|
|
|
|
$scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) { |
|
|
|
|
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); |
|
|
|
|
return in_array($item['extension'], $imgExts); |
|
|
|
|
return !empty($item['extension']) && in_array($item['extension'], $imgExts); |
|
|
|
|
}); |
|
|
|
|
}else if ($showType == 'video' && !empty($scanResults[$cateId]['files'])) { |
|
|
|
|
$scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) { |
|
|
|
|
$videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8'); |
|
|
|
|
return in_array($item['extension'], $videoExts); |
|
|
|
|
return !empty($item['extension']) && in_array($item['extension'], $videoExts); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -166,7 +166,7 @@ Class ListController extends Controller {
@@ -166,7 +166,7 @@ Class ListController extends Controller {
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (in_array($item['extension'], $imgExts)) { |
|
|
|
|
if (!empty($item['extension']) && in_array($item['extension'], $imgExts)) { |
|
|
|
|
array_push($imgs, $item); |
|
|
|
|
$index ++; |
|
|
|
|
} |
|
|
|
@ -186,7 +186,7 @@ Class ListController extends Controller {
@@ -186,7 +186,7 @@ Class ListController extends Controller {
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (in_array($item['extension'], $videoExts)) { |
|
|
|
|
if (!empty($item['extension']) && in_array($item['extension'], $videoExts)) { |
|
|
|
|
array_push($videos, $item); |
|
|
|
|
$index ++; |
|
|
|
|
} |
|
|
|
|