Adding links in user fields will automatically convert to HTML tag

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: ⚠ Raportați problemele întâmpinate pe forum! - #91 de Cosmin_Popescu - Meta - DevForum.ro

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 ).

Screenshot 2022-07-20 at 10-19-39 Profile - maiki - Sandbox Discourse Kit

Screenshot 2022-07-20 at 10-18-40 Profile - maiki - Sandbox Discourse Kit

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:

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.