hotosm / osm-tasking-manager2

Designed and built for Humanitarian OpenStreetMap Team collaborative emergency/disaster mapping, the OSM Tasking Manager 2.0 divides an area into individual squares that can be rapidly mapped by thousands of volunteers.
http://tasks.hotosm.org
Other
425 stars 156 forks source link

Encoding or Support Format of url TMS #834

Closed kleper closed 7 years ago

kleper commented 8 years ago

I am a user of TM of OpenStreetMap Colombia. I trying use a image from a GeoServer instance, this server provide a TMS url like this:

http://geonode.server/geoserver/gwc/service/gmaps?layers=geonode:layer&zoom={z}&x={x}&y={y}&format=image/png8

When i try load a task with this tms, on JOSM, the tasking manager are send me a url like this:

http://geonode.server/geoserver/gwc/service/gmaps?layers=geonode:layer&zoom=19&x=148716&y=258397&format=image/png8

The url are corrupted by the TaskManger, with this aditional text: &amp. Something is changing the encoding of the url.

I know that the Task Manajer support only this kind of url: tms[22]:http://hiu-maps.net/hot/1.0.0/kathmandu_flipped/{zoom}/{x}/{y}.png but on some cases the users can't modify the url.

Thanks.

alejandroscf commented 7 years ago

That's not working yet. Looks like the '&' char is converted to it HTML representation, breaking the url.

alejandroscf commented 7 years ago

The url for imagery is correctly stored in the database, the substitution of '&' to '&' is done in the line 87 of file /osmtm/templates/task.mako, if you change it for var imagery_url = "${project.imagery|n}"; to avoid filtering the text as html, it works ok. I don't think this could cause a security breach for injection as this parameter can only be set by users with privileges to create new tasks.

Please find attached the patch with the change. patch.txt I can prepare a pull request if necessary.

Best regards, Alejandro

pgiraud commented 7 years ago

@alejandroscf please do! Thanks.