Closed maliknajjar closed 1 year ago
Shouldn't we have that escapeUnderscores
also in some other checks like starts with
and ends with
?
@joebordes yes .. actually, I think maybe its better to even escape the $value variable itself. because we should not give the user the ability to use the underscore wildcard. and I don't think that query generator use it anywhere. wdyt?
@joebordes yes .. actually, I think maybe its better to even escape the $value variable itself. because we should not give the user the ability to use the underscore wildcard. and I don't think that query generator use it anywhere. wdyt?
I don't agree because when they do an exact search we will want to have that underscore. I mean if someone is using the equals
or not equals
, I think we need to permit that underscore "as is", no?
yes I agree. because the "_" wildcard works only when used with the LIKE keyword. so how about escaping the underscore when the LIKE keyword is used?
yes, correct. that is the idea. I shared a link to the QG code section where starts/ends/contains are, there are probably some others there that need that escape
ok, I will add it to them too
LGTM. I'll wait to see the unit tests before merging. Ok?
yes .. I will create them
thanks!
When trying to search the string "_text" it will consider the underscore as a wildcard that represents any value. in order to fix this we need to escape the underscore in the string.