From 0e1497555e6a30007cc7aaa0c71e3e1f5133fb42 Mon Sep 17 00:00:00 2001 From: Dmitriy Antipov Date: Sun, 24 Jan 2021 23:26:31 +0300 Subject: [PATCH] main --- .../fileattach/elements/snippets/snippet.fileattach.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/components/fileattach/elements/snippets/snippet.fileattach.php b/core/components/fileattach/elements/snippets/snippet.fileattach.php index 81c4d76..134dd0d 100644 --- a/core/components/fileattach/elements/snippets/snippet.fileattach.php +++ b/core/components/fileattach/elements/snippets/snippet.fileattach.php @@ -50,6 +50,9 @@ $offset = $modx->getOption('offset', $scriptProperties, 0); $totalVar = $modx->getOption('totalVar', $scriptProperties, 'total'); +$ext = str_replace(' ', '', $ext); +$ext = explode(",", $ext); + // Check access if ($groups != '') { // Forbid access for non-authorized visitor @@ -136,7 +139,7 @@ $itemArr['ext'] = strtolower( pathinfo($itemArr['name'], PATHINFO_EXTENSION)); - if (($ext != '') && ($ext != $itemArr['ext'])) continue; + if (($ext != '') && (in_array($itemArr['ext'], $ext)) == false) continue; } $list[] = $modx->getChunk($tpl, $itemArr);