zurb/foundation — pull request #4724 by clyates (2014-03-18 23:28:52+00:00)
Title: Interchange regex

The regex used to look for CSS background images matches some paths that do not contain images, specifically it matches paths that contain a /. This is because - I think - the author has used the JavaScript literal format of the regex in a Regex object constructor which uses a string, hence the / delimiters are actually part of the regex - not what was intended.

I have simplified the regex to match on image extensions at the end of the path variable and have used the literal format; saves a variable that is only used once and a line of code. All other paths now fail to match and drop through to replace the content of the interchange div.