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

Handle special characters in filters of HTML tables #806

Closed
PhilippWendler opened this issue Jan 25, 2022 · 5 comments · Fixed by #1016
Closed

Handle special characters in filters of HTML tables #806

PhilippWendler opened this issue Jan 25, 2022 · 5 comments · Fixed by #1016
Assignees

Comments

@PhilippWendler
Copy link
Member

Not all special characters are handled correctly if a user enters them as a filter for task ids or textual columns because of missing escaping. Some of them just do not work, some actually break the parsing of the URL.

Some characters are actually handled differently depending on whether they are entered on the table tab or in the filter overlay, but not sure whether either of them is working.

We should check and handle at least the following characters, and also add tests for them:

  • ?
  • #
  • &
  • =
  • (
  • )
  • ,
  • *
@PhilippWendler
Copy link
Member Author

Having _ in a column name breaks filtering for that column because internally we split various times on _.

@JawHawk
Copy link
Member

JawHawk commented Mar 4, 2024

benchexec-2024-03-05_03.06.19.mp4

@PhilippWendler & is causing a breaking error in setting and parsing of url. I checked the other characters but didn't find any odd working. Also can you provide an example for _ in column name that breaks filtering because I tried but couldn't recreate it.
I am interested in solving this issue, can you please assign it to me ?

@PhilippWendler
Copy link
Member Author

Sure, would be great!

Just make sure to coordinate with #1006 if you need to change related parts of the code (not sure).

For _ it is my suspicion that it may break stuff due to the logic in decodeFilter (cf. #1005). Maybe I am wrong, but it would still be good to have tests for it together with all the other special characters, even if they already work.

@JawHawk
Copy link
Member

JawHawk commented Mar 10, 2024

Error occurs when & is used because we are currently splitting by search.split("&"). This can be solved by using encodeURIComponent() so it converts & to %26 and decodeURIComponent() can be used to get the value back. Is this okay ?

Also why are we using url to store the filter and other values ? Is there any specific reason ? I think using localstorage or sessionstorage will also satisfy the case and will be much easier to access.

@PhilippWendler
Copy link
Member Author

PhilippWendler commented Mar 11, 2024

Yes, URI encoding seems to be the intuitive choice.

Using the URL as state storage is by design, because we want to make it possible for people to create links that directly open a specific view of the table. This is extremely useful for many users of BenchExec.

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

Successfully merging a pull request may close this issue.

2 participants