Opened 20 years ago
Last modified 15 years ago
#681 new defect
[MapServer]Save in map object doesn't distinguish between quotation and apostrophe
Reported by: | Owned by: | dmorissette | |
---|---|---|---|
Priority: | high | Milestone: | 6.0 release |
Component: | MapServer C Library | Version: | 4.2 |
Severity: | normal | Keywords: | |
Cc: | sgillies@…, hrz@… |
Description (last modified by )
PHP MapScript "save" method in "map" object doesn't distinguish between quotation and apostrophe. This may cause some parsing error when reading the new map. For example if a map contains the following string:
CONNECTION '<OGRVRTDataSource><OGRVRTLayer name="pointOfInterest"><SrcDataSource>ODBC:sp-wms-TextDSN002,PointOfInterest</SrcDataSource><SrcLayer>PointOfInterest</SrcLayer><GeometryType>wkbPoint</GeometryType><LayerSRS>WGS84</LayerSRS><GeometryField encoding="PointFromColumns" x="XCoord" y="YCoord"/></OGRVRTLayer></OGRVRTDataSource>'
the new string will look like the following after using map->save:
CONNECTION "<OGRVRTDataSource><OGRVRTLayer name="pointOfInterest"><SrcDataSource>ODBC:sp-wms-TextDSN002,PointOfInterest</SrcDataSource><SrcLayer>PointOfInterest</SrcLayer><GeometryType>wkbPoint</GeometryType><LayerSRS>WGS84</LayerSRS><GeometryField encoding="PointFromColumns" x="XCoord" y="YCoord"/></OGRVRTLayer></OGRVRTDataSource>"
Change History (8)
comment:1 by , 20 years ago
Cc: | added |
---|---|
Component: | MapScript-PHP → MapServer C Library |
Milestone: | → 4.4 release |
Status: | new → assigned |
comment:2 by , 20 years ago
I really wish we could just handle it like everyone else. Escape characters in the mapfile (e.g. \" or \') and use a string writer to escape strings before saving them. This would involve: 1) fixing the string expression in the lexer to allow escaped characters in strings (better regex's) 2) writing a function to unescape the escaped characters in each string before handing to the functions in mapfile.c (that is, call in the lexer) 3) writing a string encoder for use in saving a mapfile Call this a combination of 2,4 and 5. I really don't like options 1 and 3. If someone better than I at coding this stuff can help with the functions I can help with hooking it up. This scheme would not break old mapfiles. My 2 cents... Steve
comment:3 by , 20 years ago
I like the \" escape and had thought about it too, but there is a small chance of breaking mapfiles which already contain some '\' in their strings: they would need to be escaped as '\\'. Other than that I'd be happy with that solution. I especially like the fact that this is already a well-known way to escape chars in strings.
comment:4 by , 19 years ago
Milestone: | 4.4 release → 4.6 release |
---|
Too late for 4.4, but would be important for 4.6
comment:5 by , 18 years ago
Cc: | added |
---|
comment:6 by , 17 years ago
Description: | modified (diff) |
---|---|
Milestone: | 5.0 release → 5.2 release |
Owner: | changed from | to
Status: | assigned → new |
I wonder if the changes to escape filter strings in #2123 could help with this one?
comment:7 by , 16 years ago
Milestone: | 5.2 release → 5.4 release |
---|
comment:8 by , 15 years ago
Description: | modified (diff) |
---|---|
Milestone: | 5.4 release → 6.0 release |
Note:
See TracTickets
for help on using tickets.