Adding an external link to the Reason field (badge) fails silently

Repro on Meta:

  1. go to user admin page
  2. click on Edit badges
  3. assign a badge adding an external URL as Reason
    2018-08-28_18-46-16
  4. click Grant
  5. the badge is assigned, the Reason field remains empty

The admin should be warned that the URL is invalid (is not an internal URL) and clicking on Grant must produce the error Sorry, an error has occurred (btw a specific error is always better to identify where you are wrong).

4 Likes

Hi,

I can confirm this is the case when using external link. Do we want to throw error on external links? If yes, I can try to work on it.

Thanks

1 Like

Yes, because no error is shown when you click on Grant, so the administrators do not understand that they are wrong to insert the link.

Hi @dax ,
I have created PR for the same. I just wanted to confirm only links have to be allowed in reason, right? Plain text is also not valid, right?

https://github.com/discourse/discourse/pull/6690

Thanks

3 Likes

The only valid links are internal links to posts and topics, so no plain text.
Thanks, our engineers will review the PR soon.

2 Likes

PR has now been merged :ok_hand:

5 Likes