Page MenuHomePhabricator

GPX track is not shown with page name contains "non standard chars"
Open, Needs TriagePublicBUG REPORT

Event Timeline

The only chars admitted on the articles page name are "a-zA-Z0-9()'", while (for exampe) "èéàòùì" are not admitted.

This problem affect all the wikivoyage language versions.

Most likely wikivoyage specific behavior in a local template, gadget or JavaScript extension. Kartographer doesn’t support gpx directly

@TheDJ maybe you are right. I'm struggle finding the issue. Any support would be highly appreciated.

@TheDJ according to the incipit of this page https://en.wikivoyage.org/wiki/Template:GPX the GPX traces are being replaced with GeoJSON with the deployment of mw:Extension:Kartographer.

The GPX track (and the map) on these pages is provided by the external dynamic map tool called PoiMap2 running on Toolforge, not by Kartographer. The tool is initialised on it.wikivoyage via https://it.wikivoyage.org/w/index.php?title=MediaWiki:Gadget-MapFrame.js

The tool fetches the track from Template:GPX/<article name>. That page exists and has valid data, but the tool inserts the article title into the URL it then builds without percent-encoding it. Accented characters then produce an invalid request, the request fails and the map silently falls back to an empty track.

Fix should be made in PoiMap2 @Toolhub (specifcially poimap2.php / readpage.php), but it isn't very active. last update was 6 years ago.

@TheDJ thanks for your input.
In poimap2.php I see this instruction that use the filename:

$gpxcontent = @file_get_contents("https://" . $lang . ".wikivoyage.org/w/index.php?title=Template:GPX/" . $file . "&action=raw");

The variable $file is defined in readpage.php:

$file = str_replace("\'","'",$_GET["name"]);
$file = str_replace(" ", "_", $file);

Do you think that the above two lines should be changed into the following one:

$file = rawurlencode($_GET["name"]);

?

Last but not the least, I'm also available to make/try some tests but although once I was able to access the code through PuTTY, now I'm not anymore. If possible, how can I change the code and see/test the effects?