Accept several sizes for favicon
This commit is contained in:
parent
97564bfcc9
commit
a1acc896e2
@ -143,5 +143,5 @@ ConfirmSitemapsCreation=Confirm sitemap generation
|
|||||||
SitemapGenerated=Sitemap Generated
|
SitemapGenerated=Sitemap Generated
|
||||||
ImportFavicon=Favicon
|
ImportFavicon=Favicon
|
||||||
ErrorFaviconType=Favicon must be png
|
ErrorFaviconType=Favicon must be png
|
||||||
ErrorFaviconSize=Favicon must be of size 32x32
|
ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64
|
||||||
FaviconTooltip=Upload an image which needs to be a png of 32x32
|
FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64)
|
||||||
|
|||||||
@ -1362,7 +1362,11 @@ if ($action == 'updatecss' && $usercanedit) {
|
|||||||
}
|
}
|
||||||
$filetoread = realpath(dol_osencode($_FILES['addedfile']['tmp_name']));
|
$filetoread = realpath(dol_osencode($_FILES['addedfile']['tmp_name']));
|
||||||
$filesize = getimagesize($filetoread);
|
$filesize = getimagesize($filetoread);
|
||||||
if ($filesize[0] != 32 || $filesize[1] != 32) {
|
if ($filesize[0] != $filesize[1]) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
|
||||||
|
}
|
||||||
|
if (! $error && ($filesize[0] != 16 || $filesize[0] != 32 || $filesize[0] != 64)) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
|
setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user