Skip to content

Commit

Permalink
Merge pull request opencart#13672 from stalker780/patch-12
Browse files Browse the repository at this point in the history
Update download.php
  • Loading branch information
danielkerr committed Feb 17, 2024
2 parents df65e86 + b37f561 commit 76a8fd9
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 76a8fd9

Please sign in to comment.