diff --git a/upload/admin/controller/catalog/download.php b/upload/admin/controller/catalog/download.php index 4916ae1ece1..b293e762d89 100644 --- a/upload/admin/controller/catalog/download.php +++ b/upload/admin/controller/catalog/download.php @@ -279,7 +279,7 @@ public function save(): void { } } - if ((oc_strlen($this->request->post['filename']) < 3) || (oc_strlen($this->request->post['filename']) > 128)) { + if (!oc_validate_length($this->request->post['filename'], 3, 128)) { $json['error']['filename'] = $this->language->get('error_filename'); } @@ -291,15 +291,15 @@ public function save(): void { $json['error']['filename'] = $this->language->get('error_exists'); } - if (preg_match('/[^a-zA-Z0-9\/._-]|[\p{Cyrillic}]+/u', $this->request->post['filename'])) { + if (!oc_validate_filename($this->request->post['filename'])) { $json['error']['filename'] = $this->language->get('error_filename_character'); } - if ((oc_strlen($this->request->post['mask']) < 3) || (oc_strlen($this->request->post['mask']) > 128)) { + if (!oc_validate_length($this->request->post['mask'], 3, 128)) { $json['error']['mask'] = $this->language->get('error_mask'); } - if (preg_match('/[^a-zA-Z0-9\/._-]|[\p{Cyrillic}]+/u', $this->request->post['mask'])) { + if (!oc_validate_filename($this->request->post['mask'])) { $json['error']['mask'] = $this->language->get('error_mask_character'); }