codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
385 stars 69 forks source link

Invalid URL in user profile website during editing leads to 500 error #1169

Closed trichoplax closed 1 year ago

trichoplax commented 1 year ago

Describe the bug If a user enters text into the "Website" input box during editing their user profile, and that text is not recognised as a valid URL, the user sees a 500 error page rather than meaningful feedback.

To Reproduce Steps to reproduce the behavior:

  1. Go to your user profile page.
  2. Click on the "Edit" tab.
  3. Scroll down to the "Website" input box.
  4. Enter the text a" into the "Website" input box.
  5. Press "Save".
  6. See 500 error page.

Expected behavior The user should see feedback so that they know that it was the website that was rejected. They could have changed many things at once in that edit, and the 500 error page gives no indication of which of those things was a problem.

cellio commented 1 year ago

Also, letting 500s get to the user is not good. We should either catch it and use one of those in-page error-notification popups or accept the bad text but not linkify it if it's not actually a URL. (Presumably the former, since it sounds like the server is expecting a valid URL.)

Marking this high priority because of the 500, even though it's probably infrequent.