Adding links in user fields will automatically convert to HTML tag

AI-generated summary

A bug was reported where adding links in user fields, specifically the “Location” field, would convert to HTML tags. iamntz initially reported this issue, which was also present on Meta. maiki reproduced the issue in the Location field but not in other custom user fields. iamntz provided screenshots, and JammyDodger was able to replicate the issue.

maiki further investigated and found that the issue only occurred in the default “Location” field. The issue was caused by one-boxing, and nbianca created a PR to fix the issue. However, ti0 reported that the issue still occurred for any link on their forum.

nbianca’s fix was confirmed to work by iamntz, but it is not retroactive and requires manual cleaning of affected fields. ti0 plans to apply the patch to resolve the issue.

Couple of weeks old issue, also present here, on Meta: adding an URL inside a user field will automagically convert it to escaped HTML tag.

2022-07-19_01h39_15

4 Likes

Hi @iamntz. :wave:

I’ve reproduced this in the Location field, but not with other, custom user fields. Wanted to see if you had experienced this in another field. :slight_smile:

2 Likes

There are a couple of screenshots here: https://devforum.ro/t/raportati-problemele-intampinate-pe-forum/10162/91?u=iamntz

Basically the problem is there for any custom field that contains a link.

3 Likes

I have just given it a run-through on my test site and can replicate it happening in a user custom field too:

(I added the :uk: emoji using my phone)

1 Like

It is only happening in the default “Location” field for me, 2.9.0.beta7( 0760b249ff ).

I tried saving an emoji as well, but upon saving and refreshing the page, only the Location field is exploding the URL.

<a href="https://meta.discourse.org/" class="onebox" target="_blank" rel="noopener nofollow ugc">https://meta.discourse.org/</a>

It appears to be one-boxing, so that’s a hint. :thinking:

I fixed the issue in this PR:

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

It will be merged shortly after review.

7 Likes

@maiki @nbianca just want to add that it is happening on our forum for any link:

1 Like

Hi @ti0. :wave:

Is this a recent regression? Have you updated to the latest version that includes Bianca’s fix? :slight_smile:

I believe it is recent. We have not applied that fix yet. We are on 2.9.0.beta7 and that is the latest release available. I will check with the dev responsible if we can check that patch.

1 Like

@nbianca 's fix works great. :+1:

It’s not retroactive though, so if you have those fields messed up, you need to actually clean those manually.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.