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

Fix: Page crash on half surrogate pair #261

Merged

Conversation

jNullj
Copy link
Contributor

@jNullj jNullj commented Sep 7, 2023

This commit fixes an issue where utf-16 encoded surrogated pair could crash the page when inserted as input.
The commit adds endsWithHalfSurrogatePair to check for half pair and safeEncodeURIComponent to ignore half surrogated pair before passing it to encodeURIComponent.

I replaced encodeURIComponent with safeEncodeURIComponent to solve the bug.
I run lint, testing and and cypress and everything seems ok.
I also tested before/after changes by hand to make sure the bug is solved.

Fixes #260

This commit fixes an issue where utf-16 encoded surrogated pair could crash the page when inserted as input.
The commit adds endsWithHalfSurrogatePair to check for half pair and safeEncodeURIComponent to ignore half surrogated pair before passing it to encodeURIComponent.

Fixes cloud-annotations#260
@netlify
Copy link

netlify bot commented Sep 7, 2023

Deploy Preview for docusaurus-openapi ready!

Name Link
🔨 Latest commit 1073234
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-openapi/deploys/64fa0b3a2bd125000975916c
😎 Deploy Preview https://deploy-preview-261--docusaurus-openapi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jNullj
Copy link
Contributor Author

jNullj commented Nov 3, 2023

Ping @bourdakos1

@bourdakos1 bourdakos1 merged commit c838e1f into cloud-annotations:main Nov 4, 2023
4 checks passed
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.

This page crashed - URI malformed - When inserting win10 keyboard emoji on api field
2 participants