Add protection to allow only jpg and png as image file
This commit is contained in:
parent
61e194bb6d
commit
edd19419ad
@ -111,7 +111,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
foreach ($arrayofimages as $varforimage)
|
||||
{
|
||||
if (! preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["tmp_name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
|
||||
if ($_FILES[$varforimage]["name"] && ! preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user