#16043·chatwoot

Link custom attribute shows "---" for valid URLs with TLD longer than 6 chars

Author: Timur2915Created Sep 28, 2026Updated Sep 29, 2026
Labels😶‍🌫️ feature/custom-attributesBugFrontend

Describe the bug

A contact custom attribute of type Link is shown as --- in the contact sidebar when the URL's TLD is longer than 6 characters (e.g. .exchange, .company, .digital). The value is saved correctly: it passes validation in the edit form, and opening the editor or copying the attribute gives the full URL. Only the display is wrong.

The display and the edit form validate URLs differently:

javascript
urlValue() {
  return isValidURL(this.value) ? this.value : '---';
},

isValidURL (URLHelper.js#L62-L67) caps the TLD at 6 characters (\.[a-zA-Z0-9()]{1,6}\b):

javascript
/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/gm
isValidURL('https://admin.example.com/users/123')      // true
isValidURL('https://admin.example.exchange/users/123') // false -> rendered as '---'

The same regex also rejects valid URLs that contain , ; ! $ ' * [ ] in the path or query, or non-ASCII characters.

To Reproduce

  1. Settings → Custom Attributes → add a contact attribute of type Link.
  2. Open a contact and set the attribute to https://admin.example.exchange/users/123.
  3. Save. The editor accepts the value.
  4. The sidebar shows --- instead of the link.

Expected behavior

Any URL the edit form accepts is shown as a clickable link. One option is to use the same validator for display and for editing. Another is to replace the regex in isValidURL with a new URL(value) check limited to http:/https:.

Environment

Kubernetes (self-hosted), Chatwoot v4.18.0. The code is unchanged on develop.