Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unsafe regex in trim() function
`trim()` function contains a regular expression that is vulnerable to ReDoS but was uncaught by `safe-regex` module.
- Loading branch information
a6140a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use String.prototype.trim() instead of the regex? It would seem to me that right-padded strings are left untrimmed with this change, but using the trim() method on strings would solve the issue.
a6140a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kekkis mostly for old browser support. The code is actually meant to be removed since right-padded strings will be trimmed in the next line regardless.