MapServer / MapServer-import

3 stars 2 forks source link

[WMS Server] metadata not encoded in GetCapabilities #802

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: pspencer@dmsolutions.ca Date: 2004/08/04 - 21:40

If a WMS Server map file contains metadata to control the title of the map and
layers, and the metadata contains invalid XML characters (specifically the & in
this case), utilities that parse the capabilities document will fail because &
is an invalid character.  For example:

"wms_title" "Rivers & Streams"

will produce:

<title>Rivers & Streams</title>

which will cause xerces to dump on that line.

It is probable that all metadata that ends up in the capabilities document will
have the same problem.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/08/05 - 00:07

The simplefix for this would bo to HTML-encode all metadata values that we
output in Capabilities. There is a single location to change to do that:
msOWSPrintMetadata().

The question is whether that could break existing mapfiles in which all metadata
were already HTML-encoded. OTOH if MapServer doesn't take care of encoding
itself then that opens the possibility of generating broken capabilities
documents as what happens here. So the safe way to go is to have MapServer
HTML-encode all metadata in capabilities, and to document that behavior in the
HOWTOs.

I think I'll run that by the mapserver-dev list before I makethe change though,
just to make sure nobody has a problem with that.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/08/05 - 00:14

Actually, there is already msOWSPrintEncodeMetadata() function, so it's mostly a
matter of walking through all calls to msOWSPrintMetadata() and replacing the
ones that need to be replaced.
tbonfort commented 12 years ago

Author: jlacroix Date: 2004/09/17 - 20:49

I've start work on this.

Should I modify WFS code at the same time?
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/09/21 - 20:18

Assefa: do you see any problem with Julien updating the WFS code to
automatically encode about everything in capabilities? I told him that it was ok
to do it, so please let us know ASAP if you expect a problem.
tbonfort commented 12 years ago

Author: assefa Date: 2004/09/21 - 20:32

I do not see any problem on that.
tbonfort commented 12 years ago

Author: jlacroix Date: 2004/09/23 - 22:01

I have put code in 4.3 cvs that encode all metadatas and mapfile parameters when
outputed to a XML document.

I have changed Map Context, WFS, WMS and GML code.

The remaining issues will be in WCS and maybe in SLD code. A new bug have been
opened for both issue.
WCS: Bug 891
SLD: Bug 892