Skip to content

show_map.php should handle & in url #28

@johnksv

Description

@johnksv

Some RSS handlers htmlescape special signs in the links, such as & -> &. If the urls are then accessed directly without converting back, doma can't find the map.

Example:
Link from doma rss feed: https://kartarkiv.nydalen.idrett.no/show_map.php?user=vbj&map=7191
Link after the feed has been processed by w3 rss feed validator ( https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fkartarkiv.nydalen.idrett.no%2Frss.php ): https://kartarkiv.nydalen.idrett.no/show_map.php?user=vbj&map=7191

The later link result in doma not finding the map, and thus returning The map has been removed. to the user.
Related code:
https://github.com/matstroeng/doma/blob/master/src/show_map.controller.php#L19

Suggested solution: Doma/php should handle & as url parameter.

Edit:
Think this must be solved in code, since:

PHP's URL parser does not expect to encounter HTML entities, because they should not be present in URLs; it therefore correctly splits the query string on &, treating the trailing amp; as part of the key.
(source: https://stackoverflow.com/questions/17972654/amp-precedes-get-array-element-parameter-name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions