Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird valid regex #61

Open
Moon-0xff opened this issue Jun 9, 2023 · 2 comments
Open

Weird valid regex #61

Moon-0xff opened this issue Jun 9, 2023 · 2 comments

Comments

@Moon-0xff
Copy link
Owner

Moon-0xff commented Jun 9, 2023

If user inputs to label-filtered-list entry something like ,,,,,,,,,,,,, is converted to ||||||||||||||| and used as a regex in the line:

const filterRegex = new RegExp("(?:-|\\(|\\[).*(?:" + sanitizedInput.replace(",","|") + ").*(?:$|\\)|\\])","gi");

This is a valid regex, and acts as global wildcard, which is the behaviour I expected, but surely looks like a problematic regex.

@Moon-0xff Moon-0xff changed the title Regex sanitization might be flawed Weird valid regex Jun 9, 2023
@abisammy
Copy link
Contributor

Was thinking about this...

Might be better to implement filters in a better way, for example a more "todo list" style such as:
https://www.w3schools.com/howto/howto_js_todolist.asp
image

I'm pretty sure in gnome js, settings can be stored as arrays, so the blacklist can be stored as an array, additionaly the todo list would make it more user friendly.

This removes the annoyances of having a regex, and will fix this bug.

@Moon-0xff
Copy link
Owner Author

Moon-0xff commented Jun 11, 2023

Yes, it would remove the problems of dealing with the values, but implementing the layout itself might be a problem on it's own.

We could try to implement something like this but at this point in time it's better to wait until we can ditch GTK3 compatibility (#62).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants