Skip to content

IBX-10978: Added tel/mailto options to urlType#106

Open
reithor wants to merge 10 commits into4.6from
ibx-10978-add-tel-mailto-to-urltype
Open

IBX-10978: Added tel/mailto options to urlType#106
reithor wants to merge 10 commits into4.6from
ibx-10978-add-tel-mailto-to-urltype

Conversation

@reithor
Copy link

@reithor reithor commented Jan 13, 2026

🎫 Issue IBX-10978

Related PRs:

Description:

PR disables Symfony's FixUrlProtocolListener and introduces a custom FixUrlProtocolListener.
Symfony's FixUrlProtocolListener considers URLs like tel:123456 (without //) as having no protocol.
Those URLs will wrongly be prefixed with http://.
(Technically URLs like tel:123456 are valid).

Own implementation fixes this behavior.
For now only tel and mailto are added as allowed scheme - further improvement could make this part more flexible via config,

Reference for URL syntax:
https://en.wikipedia.org/wiki/URL#Syntax

For QA:

Documentation:

@reithor reithor marked this pull request as ready for review January 13, 2026 19:31
@reithor reithor requested a review from a team January 13, 2026 19:31
@reithor reithor force-pushed the ibx-10978-add-tel-mailto-to-urltype branch from a7b72e4 to 12c8017 Compare January 14, 2026 08:49
@reithor reithor added the Bug Something isn't working label Jan 23, 2026
@sonarqubecloud
Copy link

@reithor reithor requested a review from alongosz January 29, 2026 16:04
@reithor
Copy link
Author

reithor commented Jan 30, 2026

@alongosz :
just for the case that you want to discuss the topic in general (so decide if mailto/tel should be allowed or if you share the understanding that URLs should always have an authority) here are some sources:

https://www.rfc-editor.org/rfc/rfc1738
https://en.wikipedia.org/wiki/URL

https://url.spec.whatwg.org/#urls
https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL

@mateuszbieniek
Copy link
Contributor

Hi @alongosz any chances of moving forward with the review? :)

Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @alongosz any chances of moving forward with the review? :)

Hi @mateuszbieniek and @reithor, my apologies, looks like I made final review remarks, but I never submitted them 🤦

Here are some last nitpicks:

Comment on lines +21 to +25
/** @var string|null */
private $defaultProtocol;

/** @var \Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener */
private $fixUrlProtocolListener;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use PHP 7.4 strict types.

/**
* @param string|null $defaultProtocol The URL scheme to add when there is none or null to not modify the data
*/
public function __construct(?string $defaultProtocol = 'http')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be https by default or does it somehow influence BC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants