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

Link URL is not escaped when searching for matching protocol #1327

Closed
Danielfelgate opened this issue Nov 6, 2023 · 0 comments
Closed

Link URL is not escaped when searching for matching protocol #1327

Danielfelgate opened this issue Nov 6, 2023 · 0 comments
Milestone

Comments

@Danielfelgate
Copy link

Describe the bug
When a linkProtocol is specified in options, it seems to search the url using regex to determine if the url's protocol matches the linkProtocol option. However the url is not escaped, resulting in a SyntaxError if any regex special characters are present in the link.

To Reproduce
Steps to reproduce the behavior:

Go to http://suneditor.com/sample/html/options.html
Enable linkProtocol and set to anything e.g. https://
Select 'Create' to generate the editor
Open add link dialogue
Type a regex special character such as '[' in the URL to link input

Screenshots
image

Desktop
OS: macOS 13.5
Browser: Chrome
Version: 118.0.5993.117 (Official Build) (x86_64)

JiHong88 added a commit that referenced this issue Dec 6, 2023
fix: #1327 escape URL for safe use in regular expression
@JiHong88 JiHong88 added this to the 2.46.0 milestone Apr 14, 2024
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

No branches or pull requests

2 participants