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

Use URI encoding for search state #721

Merged
merged 3 commits into from
Dec 15, 2022
Merged

Use URI encoding for search state #721

merged 3 commits into from
Dec 15, 2022

Conversation

cdfa
Copy link
Contributor

@cdfa cdfa commented Dec 9, 2022

Instead of base64 encoding, which would fail on non ASCII characters

@@ -175,7 +175,7 @@ $.widget("ui.search_ui", {

var me = this,
hash = window.location.hash.substring(1, window.location.hash.length),
json = atob(hash),
json = decodeURIComponent(hash),
Copy link
Contributor

@robvandenbogaard robvandenbogaard Dec 14, 2022

Choose a reason for hiding this comment

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

Should we make it backward compatible? So that if we feed it a(n existing) link with btoa encoded hash, that it decodes using aotb?

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed with Colin: We can make it compatible by enclosing the decode in a try catch.

@cdfa cdfa force-pushed the search-uri-encoding branch from 3c9774e to ca4e9ec Compare December 14, 2022 13:02
Colin de Roos added 3 commits December 15, 2022 12:15
@cdfa cdfa force-pushed the search-uri-encoding branch from ca4e9ec to 7d53399 Compare December 15, 2022 11:15
@cdfa cdfa merged commit f4d1e77 into master Dec 15, 2022
@cdfa cdfa deleted the search-uri-encoding branch December 15, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants