OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-03-28 14:38:30

Brian de Ford
Member
From: Cardigan, Ceredigion, UK
Registered: 2017-08-30
Posts: 133

Taginfo template has problems

The taginfo template appears to be introducing incorrectly URL-encoded characters.

For example, on https://wiki.openstreetmap.org/wiki/Key:garden:style down near the bottom-right of the page is "Tools for this tag."  Each of the links within it have %253A instead of a colon, which displays as %3A if you hover over the link but isn't handled as such by the computer.  So you end up going to https://taginfo.openstreetmap.org/keys/garden%253Astyle.

What that template is attempting to do, why it's trying to do so in the first place, and how to fix it are far beyond my comprehension.

Offline

#2 2019-03-28 17:32:46

KiaaTiX
Member
From: Tilburg
Registered: 2018-04-22
Posts: 75

Re: Taginfo template has problems

Brian de Ford wrote:

What that template is attempting to do, why it's trying to do so in the first place, and how to fix it are far beyond my comprehension.

The correct URL should be https://taginfo.openstreetmap.org/keys/garden%3Astyle.

It is trying to encode the colon character it as its numerical value. You can do this with any character: https://taginfo.openstreetmap.org/%6b%6 … 4%79%6c%65.

It is mostly used for special characters like spaces and Unicode characters. However, the colon character is allowed in URLs so it would be possible to just use https://taginfo.openstreetmap.org/keys/garden:style.

The %252A is what you get when you encode the URL twice.

":" -> (encoding : as 2A) -> "%2A" -> (encoding % as 25) -> "%252A"

Last edited by KiaaTiX (2019-03-28 17:33:12)

Offline

#3 2019-03-28 17:39:58

Brian de Ford
Member
From: Cardigan, Ceredigion, UK
Registered: 2017-08-30
Posts: 133

Re: Taginfo template has problems

KiaaTiX wrote:

The %252A is what you get when you encode the URL twice.

Indeed.  But what I don't know is why somebody thought it necessary to do that or what they were hoping to achieve.  Presumably that person was trying to do something and any simple fix may break something else.  I decided it was better to leave it alone and bring it to the attention of others who may understand the thinking behind it.

Offline

#4 2019-03-29 14:21:55

Tigerfell
Member
Registered: 2018-09-01
Posts: 76

Re: Taginfo template has problems

I tried to fix it myself, but could not locate the relevant code. I reported it in the wiki now (https://wiki.openstreetmap.org/wiki/Tem … info_links).

Offline

#5 2019-03-29 20:48:07

nyuriks
Member
Registered: 2016-11-18
Posts: 87

Re: Taginfo template has problems

Offline

Board footer

Powered by FluxBB