我从这行 javascript 中收到此 jshint 错误“不安全的 '^'”:
var test = content.replace(/d=([^&]*)/, 'd=test');
有谁知道我该如何解决这个问题?
最佳答案
检查容忍。和[^...]。在/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 .
关于jslint - 不安全的 '^' jshint 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7250993/