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 #1016

Merged
merged 9 commits into from
Mar 22, 2024

Conversation

JawHawk
Copy link
Member

@JawHawk JawHawk commented Mar 14, 2024

Fixes #1015
Fixes #806

Solved the Id filter being removed when other filters are applied by fixing the setURLParameter function.

Added encodeURIComponent in makeFilterSerializer function to escape special characters and decodeURIComponent in tokenizePart function to get the filter value back.
Also fixed decodeFilter for column names having _

Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Does the handling of _ and other special characters also work for filters that are set for other textual columns, i.e., not the id column?

I am also a little bit skeptical about the existing filter-parsing logic. Could you please add tests that have just one an opening parentheses? I would like to see that this works as well.

@JawHawk
Copy link
Member Author

JawHawk commented Mar 16, 2024

I am also a little bit skeptical about the existing filter-parsing logic. Could you please add tests that have just one an opening parentheses? I would like to see that this works as well.

Yes, even the online example https://sosy-lab.github.io/benchexec/example-table/svcomp-simple-cbmc-cpachecker.table.html#/table?filter=id_any(value())) breaks when only one closing parentheses is used. This is due to the tokenizePart function logic of considering '(' and ')'. For this, parantheses in the string values should also be escaped but encodeURIComponent doesn't do so. String values need to be replacedAll with %28 and %29 respectively. That will make it work.

@PhilippWendler
Copy link
Member

Thanks for investigating! Would you like to add this to this PR?

@JawHawk
Copy link
Member Author

JawHawk commented Mar 18, 2024

Thanks for investigating! Would you like to add this to this PR?

I have done the necessary changes. Please review them.

Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Seems to work fine in my tests. I also like that many unit tests are added, this is always good.

I have just some minimal suggestions left, but otherwise it is ready to merge from my point of view. If you agree, could you please also update the pre-built files?

@PhilippWendler PhilippWendler merged commit 64d73c4 into sosy-lab:main Mar 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Id filter is removed when other filters are used Handle special characters in filters of HTML tables
2 participants