Insecure '^' jshint issue
I am getting this jshint error "Insecure '^'" from this line of javascript:
var test = content.replace(/d=([^&]*)/, 'd=test');
Anyone know how I can res开发者_运维知识库olve this issue?
Check Tolerate . and [^...]. in /RegExp/.
true if . and [^...] should be allowed in RegExp literals. They match more material than might be expected, allowing attackers to confuse applications. These forms should not be used when validating in secure applications.
Source.
精彩评论