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

Improve the regularization term #288

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ShiyuBanzhou
Copy link

To resolve this #286 issue, it is recommended to replace the original code containing the inefficient regular expression with the following optimized version:

return url.replace(/^[\u0000-\u001F\u0020]+$/ug, "");

image-1
This alternative simplifies the regular expression by removing the redundant | (OR) operator, effectively resolving the inefficient backtracking behavior. This optimization prevents potential performance degradation when handling specific inputs, ensuring more efficient processing.

@ShiyuBanzhou ShiyuBanzhou reopened this Jan 29, 2025
@ShiyuBanzhou
Copy link
Author

Hello, sorry to bother you. Now I have fixed the regular item vulnerability to ensure that its function is consistent with the original business logic. Thank you for your reminder.

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.

1 participant