Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone numbers in tel: URLs contain spaces in contravention of RFC3966 #16460

Closed
pv2b opened this issue Jun 10, 2024 · 2 comments · Fixed by #16632
Closed

Phone numbers in tel: URLs contain spaces in contravention of RFC3966 #16460

pv2b opened this issue Jun 10, 2024 · 2 comments · Fixed by #16632
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@pv2b
Copy link
Contributor

pv2b commented Jun 10, 2024

Deployment Type

Self-hosted

NetBox Version

v4.0.3

Python Version

3.11

Steps to Reproduce

  1. Set the phone number for a contact to a number with spaces, e.x. +1 800 123 45 67
  2. Go to the contact detail page and hover over the phone number, and observe the link generated. (This also applies to the contact list table.)

Expected Behavior

The URL generated should be tel:+18001234567, removing spaces as per RFC3966 section 5.1.1:

However, even though ITU-T E.123 [E.123] recommends the use of space characters as visual separators in printed telephone numbers, "tel" URIs MUST NOT use spaces in visual separators to avoid excessive escaping.

Observed Behavior

The URL generated is actually tel:+1 800 123 45 67 which neither strips nor URL-encodes the spaces.

Inspecting the HTML code would show something like:

<a href="tel:+1 800 123 45 67">+1 800 123 45 67</a>
@pv2b pv2b added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Jun 10, 2024
@pv2b
Copy link
Contributor Author

pv2b commented Jun 10, 2024

The relevant function to change looks like it's here:

def linkify_phone(value):
"""
Render a telephone number as a hyperlink.
"""
if value is None:
return None
return f"tel:{value}"

@pv2b
Copy link
Contributor Author

pv2b commented Jun 10, 2024

Can confirm this is still present in v4.0.5

@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels Jun 10, 2024
@arthanson arthanson removed their assignment Jun 10, 2024
@arthanson arthanson added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jun 17, 2024
@arthanson arthanson self-assigned this Jun 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants