aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/list
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-05-05 12:49:11 +0200
committerSascha <GlancingMind@outlook.com>2021-05-20 17:07:47 +0200
commit7446a20db8907acedbd14ddcc6a99de577268c1c (patch)
tree2fdcffc9bc824d2140b6060113216e0c52182073 /webui/src/pages/list
parent77d36247b3b761e21ef38a764d315cd4d22e7668 (diff)
downloadgit-bug-7446a20db8907acedbd14ddcc6a99de577268c1c.tar.gz
Do not greedy match quotes
Diffstat (limited to 'webui/src/pages/list')
-rw-r--r--webui/src/pages/list/Filter.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/webui/src/pages/list/Filter.tsx b/webui/src/pages/list/Filter.tsx
index 84b08029..496fb3ba 100644
--- a/webui/src/pages/list/Filter.tsx
+++ b/webui/src/pages/list/Filter.tsx
@@ -36,7 +36,7 @@ export type Query = { [key: string]: string[] };
function parse(query: string): Query {
const params: Query = {};
- let re = new RegExp(/(\w+)(:('.*'|".*"|\S*))?/, 'g');
+ let re = new RegExp(/([^:\s]+)(:('[^']*'\S*|"[^"]*"\S*|\S*))?/, 'g');
let matches;
while ((matches = re.exec(query)) !== null) {
if (!params[matches[1]]) {
@@ -53,8 +53,8 @@ function parse(query: string): Query {
function quote(value: string): string {
const hasSpaces = value.includes(' ');
- const isDoubleQuotedRegEx = RegExp(/^'.*'$/);
- const isSingleQuotedRegEx = RegExp(/^".*"$/);
+ const isSingleQuotedRegEx = RegExp(/^'.*'$/);
+ const isDoubleQuotedRegEx = RegExp(/^".*"$/);
const isQuoted = () =>
isDoubleQuotedRegEx.test(value) || isSingleQuotedRegEx.test(value);