Skip to content

Conversation

jainkuniya
Copy link
Member

Encode url with encodeURI before passing it to safari view.

Refer issue thread for complete diagnosis.

Fixes: #3315

@gnprice
Copy link
Member

gnprice commented Jun 4, 2019

Thanks @jainkuniya !

You were able to reproduce #3315, right? Can you confirm that you've tried the repro against this branch, and it fixes the issue?

@jainkuniya
Copy link
Member Author

Yup! I am able to reproduce the issue and on this PR it is working absolutely fine 👍

The `SafariView` library apparently crashes when passed a `url`
parameter that isn't all ASCII.  Strictly such a thing isn't
a URL (or URI), in fact, but rather an "IRI":
  https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier

Fix the issue by encoding the IRI in ASCII as a proper URI/URL.
The standard JS function `encodeURI` does the job.

Fixes: zulip#3315

[greg: expanded commit message]
@gnprice
Copy link
Member

gnprice commented Jun 4, 2019

Excellent, thanks -- merged!

@gnprice gnprice merged commit 66a9e9d into zulip:master Jun 4, 2019
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.

Exception in SafariView on non-ASCII URLs ("unsupported scheme")

2 participants