Opened 16 years ago

Closed 13 years ago

#2624 closed defect (duplicate)

Single quote escaping in FILTER expressions on shapefiles

Reported by: mikitessaro Owned by: sdlime
Priority: normal Milestone:
Component: MapServer C Library Version: 5.0
Severity: normal Keywords: shapefile filter escaping
Cc: dmorissette

Description

Quotes escaping in filter expressions on shapefile does not work properly with shapefile is string values ar enclosed with single quotes. For example, FILTER ("XY\'Z"="XY\'Z") works fine, but FILTER ('XY\'Z'='XY\'Z') don't. For my work filter expressions are build programmatically and enclosing strings in double quotes is not pratical. For testing I've attached two maps: filterOK.map works fine and uses double quotes for string enclosing, while filterKO.map uses single quotes. Use the attached shapefile for testing. I've tested with MapServer v5.0.2 (ms4w 2.2.7) on Windows 2003.

Attachments (3)

comuni.zip (124.8 KB ) - added by mikitessaro 16 years ago.
Shapefile for testing
filterOK.map (570 bytes ) - added by mikitessaro 16 years ago.
mapfile with filter working correctly
filterKO.map (564 bytes ) - added by mikitessaro 16 years ago.
mapfile with filter not working; strings are enclosed with single quotes

Download all attachments as: .zip

Change History (5)

by mikitessaro, 16 years ago

Attachment: comuni.zip added

Shapefile for testing

by mikitessaro, 16 years ago

Attachment: filterOK.map added

mapfile with filter working correctly

by mikitessaro, 16 years ago

Attachment: filterKO.map added

mapfile with filter not working; strings are enclosed with single quotes

comment:1 by dmorissette, 13 years ago

Cc: dmorissette added

Steve: Is "\'" expected to be a valid escape sequence in MS 5.x? (I don't think there is any escaping mechanism in place yet, checking)

comment:2 by aboudreault, 13 years ago

Resolution: duplicate
Status: newclosed

This has been implemented and will be in MapServer 6.0. See #3706.

Note: See TracTickets for help on using tickets.