Skip to content

Commit

Permalink
Update download.php
Browse files Browse the repository at this point in the history
  • Loading branch information
stalker780 authored Feb 11, 2024
1 parent 147d2a3 commit b37f561
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions upload/admin/controller/catalog/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand Down

0 comments on commit b37f561

Please sign in to comment.