Skip to content

Add geo: protocol in Url::isAbsolute(), Html::a() #2536

@WebMechanic

Description

@WebMechanic

This might not be considered a bug but an incomplete implementation in at least two classes:

Describe the bug
I ran into #2002 by accident to learn Url::isAbsolute() is missing location links that open in Map Apps. Such links use the geo: protocol. The RegEx should be updated to:

preg_match('!^(//|[a-z0-9+-.]+://|mailto:|tel:|geo:)!i', $url)

Html::a() might also be corrected and maybe include a validation method geo() to check for longitude, lattitude floats, followed by optional parameters for zoom, i.e geo:49.0158,8.3239?z=11

Additional context
geo: URLs typically only work on most Smartphones "out of the box" id some "Map" app is properly installed.
OpenStreetMap allows to "share" location URLs using a geo Link and other services might do so as well.
Desktop computers usually lack such apps although there is Bing Maps for Win10 and presumably something from Apple for iOS. No clue for Desktop Linuxes.

Stay healthy!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions