BlocklandGlass / GlassWebsite

The old Glass website.
https://blocklandglass.com
4 stars 5 forks source link

Consider adding on-the-fly submission checking #34

Closed 31547 closed 6 years ago

31547 commented 6 years ago

this is for addons/upload/upload.php.

it could be a good idea to add on-the-fly checking for if your submission is valid. so rather than type "kill yourself" into the filename then attempt to submit it perhaps it could make an ajax get request every second or so for the submission to return the errors and display them.

McTwist commented 6 years ago

I'd like to modify your suggestion. Calling AJAX once every second is bad for the server. Also, relying on AJAX is worse.

Therefore, doing as most other websites does, is to check for input from the user and if nothing has been done for the last 1-2 seconds, then check with AJAX to ensure the input is legit. However, when uploading it, we will check it on the server and raise an error if needed. As I said before, relying on AJAX alone is bad behavior and huge security concern.

Yes, I am aware that GitHub uses AJAX to update the time on anything that have happened on the site, but in your case it's not needed.

31547 commented 6 years ago

what do you mean by legit?

McTwist commented 6 years ago

Legit in this context means: valid; correct; usable.