52 $this->_scopeConfig = $scopeConfig;
64 if (!$this->_messageTemplates) {
65 $this->_messageTemplates = [
66 self::PROTECTED_EXTENSION =>
__(
'File with an extension "%value%" is protected and cannot be uploaded'),
79 if (!$this->_protectedFileExtensions) {
81 if (is_string($extensions)) {
82 $extensions = explode(
',', $extensions);
84 foreach ($extensions as &$ext) {
85 $ext = strtolower(trim($ext));
87 $this->_protectedFileExtensions = (array)$extensions;
100 return $this->_scopeConfig->getValue(
101 self::XML_PATH_PROTECTED_FILE_EXTENSIONS,
102 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
122 if (in_array($this->_value, $this->_protectedFileExtensions)) {
123 $this->
_error(self::PROTECTED_EXTENSION, $this->_value);
_error($messageKey, $value=null)