q icon indicating copy to clipboard operation
q copied to clipboard

Escape backslash

Open DimiT opened this issue 6 years ago • 2 comments

There are case when there are "\" symbols in where clause which breaks correct SOQL query.

e.g. (select id from account where name = '\'somevalue')

In that case query which will be produced by String.escapeSingleQuotes will only escape single quote symbol but not "\". Therefore query which will be produced will be as "select id from account where name ='\\'somevalue'" and this SOQL query will be incorrect.

DimiT avatar Dec 28 '18 23:12 DimiT

@DimiT Good catch! Mind working on a PR to fix this? :)

jpmonette avatar Dec 28 '18 23:12 jpmonette

Unforunately I'm not an Apex developer.

DimiT avatar Jan 09 '19 22:01 DimiT