chrisdanford/grunt-ver — pull request #2 by stuartf (2012-12-13 17:52:01+00:00)
Title: refrences regex doesn't escape '.'

When doing the substitutions in references the regex looks like:

regex = new RegExp('\\b' + to.basename + '\\b', 'g');

So if you have a basename like `foo.js` and a path like `/foo/js/bar.js` the `foo/js` will be replaced when it shouldn't. Before building that regex it would be safer to escape all the regex special characters from `to.basename`, someone on StackOverflow has even already written a regex to do that: http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript/3561711#3561711