Skip to content

Commit 12a14a6

Browse files
authored
Added hadling of allowed_extensions for file uploads in backend's configuration section (#4078)
1 parent 6ccaabf commit 12a14a6

File tree

1 file changed

+7
-0
lines changed
  • app/code/core/Mage/Adminhtml/Model/System/Config/Backend

1 file changed

+7
-0
lines changed

app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ protected function _appendScopeInfo($path)
188188
*/
189189
protected function _getAllowedExtensions()
190190
{
191+
/** @var Varien_Simplexml_Element $fieldConfig */
192+
$fieldConfig = $this->getFieldConfig();
193+
$el = $fieldConfig->descend('upload_dir');
194+
if (!empty($el['allowed_extensions'])) {
195+
$allowedExtensions = (string)$el['allowed_extensions'];
196+
return explode(',', $allowedExtensions);
197+
}
191198
return [];
192199
}
193200

0 commit comments

Comments
 (0)