Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMS:GetFeatureInfo, encoding of gml:name #5361

Closed
foggel opened this issue Dec 21, 2016 · 1 comment
Closed

WMS:GetFeatureInfo, encoding of gml:name #5361

foggel opened this issue Dec 21, 2016 · 1 comment

Comments

@foggel
Copy link

foggel commented Dec 21, 2016

gml output from WMS:GetFeatureInfo is invalid if the wms_title of a layer contains "&".

Mapfile:

[snip]
LAYER
  NAME "layer1"
  METADATA
    "wms_title" "this & that"
  END
[snip]

Request:
?REQUEST=GetFeatureInfo&INFO_FORMAT=application/vnd.ogc.gml

Output:

<?xml version="1.0" encoding="UTF-8"?>

<msGMLOutput 
         xmlns:gml="http://www.opengis.net/gml"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <layer1_layer>
        <gml:name>this & that</gml:name>
[snip]

The <gml:name> element in the result is in plain text: <gml:name>this & that</gml:name> but it should be xml encoded <gml:name>this &amp; that</gml:name>

Since the output is not valid gml, clients like QGIS will fail to consume the result. In the case of QGIS the end user will see "No features found".

I think the problem is in mapgml.c:1458 where msOWSPrintMetadata() should be changed to msOWSPrintEncodeMetadata()

@foggel foggel changed the title GetFeatureInfo, gml:name encoding WMS:GetFeatureInfo, encoding of gml:name Dec 24, 2016
ravhed added a commit to ravhed/mapserver that referenced this issue Apr 18, 2019
sdlime added a commit that referenced this issue Apr 18, 2019
GML:Name is now encoded in WMS GetFeatureInfo (fixes #5361)
@sdlime
Copy link
Member

sdlime commented Apr 18, 2019

An old one that should have been fixed long ago. Closing now though... --Steve

@sdlime sdlime closed this as completed Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants