You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// trimEnd by token without regular expression// /c*$/ is vulnerable to REDOS. ??function_trimEnd(text,token){while(text&&token&&text.substring(text.length-token.length)===token){text=text.substring(0,text.length-token.length)}returntext}
The text was updated successfully, but these errors were encountered:
听说有一个操作,叫做 REDOS,形如
/c*$/
的正则构造可能会导致 REDOS,吓得我赶紧写了一个方法做为替代:The text was updated successfully, but these errors were encountered: