MyBB Community Forums

Full Version: Avatar Bug [R]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just happened to me (right here on this board). I uploaded an avatar first, and decided to use a different one. I didn't notice the file size limit, and my avatar was 1kb over the limit. So it rejected it as it should, but instead of reverting to the old one (I guess it dumps the current one as soon as it receives the POST) I have a 404'd avatar Toungue

My suggestion would to upload the avatar to a temp dir, check it, and then remove the older one. Thanks.
Oddly, I can't seem to reproduce this on my local dev copy.
This doesn't seem to be a bug with MyBB. It removes the avatar automatically once you specify a new one, even if it's invalid. This might be something we'll change in a later version.
Moving back to bug reports. I believe this is a valid bug. If we remove the file, and don't have a replacement then we should either remove the link so it doesn't generate a 404 trying to access the avatar or revert back to the old one.
^True... Didn't think about the 404 error being generated.
Add a hidden field with the old avatar name. Don't delete until new avatar is accepted. If rejected use the hidden field. Only delete old after approval.

I am probably stating the obvious.
What's to say that the user doesn't change the value in the hidden field by POST'ing a custom form? That could end up being bad.
Hmm...good point. I'll be curious to see then how you fix this.
Ideally it would be best to upload it under a temp name, and then simply delete the old one and rename it once we've verified we're all good. It'll depend on how much effort that takes though in the code.

Ryan
Moving to suggestions because this is really more of a request to add reversion capabilities and it requires a fair amount of code changes (more then what should be done for a bug fix/maintenance release)