0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server
Aileen Nowak 5c94151e14 Blog icon validations (#7893)
refs #7688

Adds an `uploads/icon/` endpoint to the api route to get a seperate entry point for blog icon validations. The blog icon validation will specifically check for images which have icon extensions (`.ico` & `.png`) and throw errors if:

- the icon file size is too big (>100kb)
- the icon is not a squaer
- the icon size is smaller than 32px
- the icon size is larger than 1000px
- the icon is not `.ico` or `.png` extension

TODOs for this PR:
- [X] get image dimensions
- [X] validate for image
	- [X] size
	- [X] form (must be square)
	- [X] type
	- [X] dimenstion (min 32px and max 1,000px)
- [X] return appropriate error messages
- [X] write tests

--------------------

TODOs for #7688:
- [X] Figure out, which favicon should be used (uploaded or default) -> #7713
- [ ] Serve and redirect the favicon for any browser requests, incl. redirects -> #7700 [WIP]
- [X] Upload favicon via `general/settings` and implement basic admin validations -> TryGhost/Ghost-Admin#397
- [X] Build server side validations -> this PR
2017-01-26 10:01:52 +01:00
..
admin 🎨 public config endpoint (#7631) 2016-10-28 14:07:46 +01:00
api Blog icon validations (#7893) 2017-01-26 10:01:52 +01:00
apps More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00
auth 🎨 optimisations for brute (#7867) 2017-01-23 22:44:39 +01:00
blog 💄 Improve URL consistency, Part 1: urlJoin (#7668) 2016-11-14 14:38:55 +00:00
config Blog icon validations (#7893) 2017-01-26 10:01:52 +01:00
controllers/frontend Make AMP optional (#7830) 2017-01-17 16:40:06 +01:00
data 🐛 re-run init migrations protection (#7899) 2017-01-25 22:08:09 +01:00
events
helpers Make AMP optional (#7830) 2017-01-17 16:40:06 +01:00
mail More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00
middleware Blog icon validations (#7893) 2017-01-26 10:01:52 +01:00
models 🔥 😎 remove old migrations (#7887) 2017-01-25 13:47:49 +00:00
permissions 🐛 fix invite permissions for editor (#7889) 2017-01-25 12:07:31 +00:00
scheduling Shows help message for broken require in scheduler adapter (#7706) 2017-01-16 21:49:41 +01:00
storage 💄 Improve URL consistency, Part 1: urlJoin (#7668) 2016-11-14 14:38:55 +00:00
themes 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
translations Blog icon validations (#7893) 2017-01-26 10:01:52 +01:00
utils More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00
views
app.js 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
errors.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
filters.js
ghost-server.js More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00
i18n.js
index.js chore(package): update uuid to version 3.0.0 (#7742) 2017-01-04 17:10:29 +01:00
logging.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
overrides.js
update-check.js More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00