0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 Fixed wrong min-width publication icon validation

closes #8797 

Changed the min-width for publication icon validation to allow icon greater or equal to 60px, rather than greater only.
This commit is contained in:
Grant Winney 2017-08-01 04:20:23 -04:00 committed by Aileen Nowak
parent c813900f61
commit d8fb7ce7f6

View file

@ -56,13 +56,13 @@ module.exports = function blogIcon() {
return next(new errors.ValidationError({message: i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions})}));
}
// CASE: icon needs to be bigger than 60px
// CASE: icon needs to be bigger than or equal to 60px
// .ico files can contain multiple sizes, we need at least a minimum of 60px (16px is ok, as long as 60px are present as well)
if (req.file.dimensions.width <= 60) {
if (req.file.dimensions.width < 60) {
return next(new errors.ValidationError({message: i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions})}));
}
// CASE: icon needs to be smaller than 1000px
// CASE: icon needs to be smaller than or equal to 1000px
if (req.file.dimensions.width > 1000) {
return next(new errors.ValidationError({message: i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions})}));
}