# Adding links in user fields will automatically convert to HTML tag

**URL:** https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220
**Category:** Bug
**Created:** [July 18, 2022, 10:40pm UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220 "2022-07-18T22:40:31Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [July 18, 2022, 10:40pm UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/1 "2022-07-18T22:40:31Z")

</div>

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](https://global.discourse-cdn.com/meta/original/4X/0/7/4/074faf3bfa04d6a5fb34c82164b7d4b92370a888.gif)

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [July 19, 2022, 8:02pm UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/2 "2022-07-19T20:02:11Z")

</div>

Hi @iamntz. 👋

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

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [July 19, 2022, 8:24pm UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/3 "2022-07-19T20:24:35Z")

</div>

There are a couple of screenshots here: [https://devforum.ro/t/raportati-problemele-intampinate-pe-forum/10162/91?u=iamntz](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.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 20, 2022, 10:49am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/4 "2022-07-20T10:49:36Z")

</div>

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

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/9/5/b95ea77a167c13cd6ebe4c3ec97ee8cc28732ed6.png)

(I added the 🇬🇧 emoji using my phone)

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [July 20, 2022, 5:22pm UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/6 "2022-07-20T17:22:42Z")

</div>

It is _only_ happening in the default “Location” field for me, 2.9.0.beta7([0760b249ff](https://github.com/discourse/discourse/commits/0760b249ffe39a9ff57b7e36b6304e63a5082d7e)).

 ![Screenshot 2022-07-20 at 10-19-39 Profile - maiki - Sandbox Discourse Kit](https://global.discourse-cdn.com/meta/original/4X/1/1/6/11667862ae270ce1e0b2f36e55303313ca4bf0c5.png)

 ![Screenshot 2022-07-20 at 10-18-40 Profile - maiki - Sandbox Discourse Kit](https://global.discourse-cdn.com/meta/original/4X/2/b/1/2b179cc7ce17cd60fd7c4144344be9d5bb7d80c2.png)

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

```plaintext
<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. 🤔

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [July 21, 2022, 9:59am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/10 "2022-07-21T09:59:15Z")

</div>

I fixed the issue in this PR:

[https://github.com/discourse/discourse/pull/17590](https://github.com/discourse/discourse/pull/17590)

It will be merged shortly after review.

---

<div class="post-metadata">

### Author: ![ti0](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ti0/32/184402_2.png) [@ti0](https://meta.discourse.org/u/ti0)
#### Post date: [July 28, 2022, 12:03am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/13 "2022-07-28T00:03:33Z")

</div>

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

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/a/d/7ada818793c4202ab4014faa5bf709f62a513802.png)

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [July 28, 2022, 12:21am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/14 "2022-07-28T00:21:02Z")

</div>

Hi @ti0. 👋

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

---

<div class="post-metadata">

### Author: ![ti0](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ti0/32/184402_2.png) [@ti0](https://meta.discourse.org/u/ti0)
#### Post date: [July 28, 2022, 1:57am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/15 "2022-07-28T01:57:34Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [July 28, 2022, 8:03am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/16 "2022-07-28T08:03:22Z")

</div>

@nbianca 's fix works great. 👍

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

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [July 31, 2022, 8:04am UTC](https://meta.discourse.org/t/adding-links-in-user-fields-will-automatically-convert-to-html-tag/233220/17 "2022-07-31T08:04:09Z")

</div>

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