Add protection to allow only jpg and png as image file
This commit is contained in:
parent
582ae36e6c
commit
61e194bb6d
@ -111,6 +111,12 @@ 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.
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($_FILES[$varforimage]["tmp_name"])
|
||||
{
|
||||
$reg = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user