Skip to content

Embedded apostrophe in values get removed. (included fix below) #3

@nthdominion

Description

@nthdominion

Using a value that has embedded single ticks, the ticks will be wiped when using the following example:
[CustomAttributes.ConditionalRequired("Field=='Doctor's Office'" ...

This should come out to "Doctor's Office", not "Doctors Office" due to the unguarded/greedy string.replalce() used. Only the first/last tick should be removed.

Fix: change ExpressionParser._GetValue()
OLD:
if (valueString.StartsWith("'") && valueString.EndsWith("'"))
return valueString.Replace("'", string.Empty);
NEW:
if (valueString.StartsWith("'") && valueString.EndsWith("'"))
return valueString.Substring(1, valueString.Length - 2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions