Skip to content

Commit

Permalink
Update ps_imageslider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
buggyzap committed Jun 26, 2024
1 parent 9fc2ec2 commit 365e64c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ps_imageslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ protected function _postProcess()
} elseif (!$temp_name || !move_uploaded_file($_FILES['image_' . $language['id_lang']]['tmp_name'], $temp_name)) {
return false;
} elseif (!ImageManager::resize($temp_name, __DIR__ . '/images/' . $salt . '_' . $_FILES['image_' . $language['id_lang']]['name'], null, null, $type)) {
$errors[] = $this->displayError($this->trans('An error occurred during the image upload process.', [], 'Admin.Notifications.Error'));
$errors[] = $this->trans('An error occurred during the image upload process.', [], 'Admin.Notifications.Error');
}
if (file_exists($temp_name)) {
@unlink($temp_name);
Expand All @@ -497,7 +497,7 @@ protected function _postProcess()
} elseif (Tools::getValue('image_old_' . $language['id_lang']) != '') {
$slide->image[$language['id_lang']] = Tools::getValue('image_old_' . $language['id_lang']);
} else {
$errors[] = $this->displayError($this->trans('Uploaded file is not supported, only jpg, gif, jpeg, png are allowed.', [], 'Admin.Notifications.Error'));
$errors[] = $this->trans('Image format not recognized, allowed formats are: jpg, gif, jpeg, png.', [], 'Admin.Notifications.Error');
}
}

Expand All @@ -506,10 +506,10 @@ protected function _postProcess()
/* Adds */
if (!Tools::getValue('id_slide')) {
if (!$slide->add()) {
$errors[] = $this->displayError($this->trans('The slide could not be added.', [], 'Modules.Imageslider.Admin'));
$errors[] = $this->trans('The slide could not be added.', [], 'Modules.Imageslider.Admin');
}
} elseif (!$slide->update()) {
$errors[] = $this->displayError($this->trans('The slide could not be updated.', [], 'Modules.Imageslider.Admin'));
$errors[] = $this->trans('The slide could not be updated.', [], 'Modules.Imageslider.Admin');
}
$this->clearCache();
}
Expand Down

0 comments on commit 365e64c

Please sign in to comment.