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

Layer class LIST Expression #5245

Merged
merged 1 commit into from Feb 18, 2016
Merged

Layer class LIST Expression #5245

merged 1 commit into from Feb 18, 2016

Conversation

tbonfort
Copy link
Member

@tbonfort tbonfort commented Feb 18, 2016

It seems that each list item is compared to the string attribute item but it is not checked if it is the whole string.

CLASSITEM 'event'  
EXPRESSION {rain,drizzle}

This expression above returns true if "event" string attribute = "freezing rain"
A user suggested this fix
From https://github.com/mapserver/mapserver/blob/157fa474ff8748ec42652f49dc4e2be4ca89042e/maputil.c#L490
Line 490 should probably read:
if(!strncmp(start,shape->values[itemindex],end-start) && shape->values[itemindex][end-start] == '\0') return MS_TRUE;

Here are other examples where Expression returns true, but might not be the same problem/solution

String=freezing rain
EXPRESSION {rain,freezing drizzle} #doc says no space should be used though
String=freezing rain
EXPRESSION {rain,freezing,drizzle}

tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Feb 18, 2016
@tbonfort tbonfort merged commit 0d71c41 into MapServer:branch-7-0 Feb 18, 2016
@tbonfort tbonfort deleted the issues/5245-list-expression-bug branch Feb 18, 2016
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

Successfully merging this pull request may close these issues.

None yet

1 participant