History

Added escape to query

Dularian committed 4 years ago

Commit 1f0deeb1 parent 456d3ab1 file · +4 −2Browse files

Showing the changes to Source/Libraries/GSF.Web/Model (1 of 1 file). Show all

Unified · Split

Source/Libraries/GSF.Web/Model/ModelController.cs+4−2
@@ -524,8 +524,10 @@ namespace GSF.Web.Model · 523 unmodified lines
524524 things = things.Select(t => $"'{t}'").ToList();
525525 search.SearchText = $"({string.Join(",", things)})";
526526 }
527−
528− return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText}";
527+ string escape = "ESCAPE '$'";
528+ if(search.Operator != "LIKE")
529+ escape = "";
530+ return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText} {escape}";
529531 }));
530532
531533 if (searches.Any())

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t