Skip to content

Commit

Permalink
Merge pull request #648 from buggyzap/patch-1
Browse files Browse the repository at this point in the history
Added avif support to blockreassurance icon images
  • Loading branch information
leemyongpakva authored Feb 29, 2024
2 parents 2f0a7d6 + 5bc914b commit 740d5fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions controllers/admin/AdminBlockListingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ public function displayAjaxSaveBlockContent()
$type_link = (int) Tools::getValue('typelink');
$id_cms = (int) Tools::getValue('id_cms');
$psr_languages = (array) json_decode(Tools::getValue('lang_values'));
$authExtensions = ['gif', 'jpg', 'jpeg', 'jpe', 'png', 'svg'];
$authMimeType = ['image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/svg', 'image/svg+xml'];
$authExtensions = ['gif', 'jpg', 'jpeg', 'jpe', 'png', 'svg', 'avif'];
$authMimeType = ['image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/svg', 'image/svg+xml', 'image/avif'];

if (!empty($picto) && !in_array(pathinfo($picto, PATHINFO_EXTENSION), $authExtensions)) {
$errors[] = Context::getContext()->getTranslator()->trans('Image format not recognized, allowed formats are: .gif, .jpg, .png', [], 'Admin.Notifications.Error');
$errors[] = Context::getContext()->getTranslator()->trans('Image format not recognized, allowed formats are: .gif, .jpg, .png, .svg, .avif', [], 'Admin.Notifications.Error');

return $this->ajaxRenderJson(empty($errors) ? 'success' : 'error');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</label>
</div>
<div class="help-block">
{l s='Choose SVG for better customization. Other allowed formats are: .gif, .jpg, .png' d='Modules.Blockreassurance.Admin'}
{l s='Choose SVG for better customization. Other allowed formats are: .gif, .jpg, .png, .avif' d='Modules.Blockreassurance.Admin'}
</div>
</div>
<div class="clearfix"></div>
Expand Down

0 comments on commit 740d5fa

Please sign in to comment.