Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #82 from gotcha/gh-pages

Fix for issue #81
  • Loading branch information...
commit bbf08a3fbe7a474bbf44f6dde3dbd33075e48beb 2 parents b49dbeb + 1b6d3d8
Lea Verou authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 prefixfree.js
6 prefixfree.js
View
@@ -52,8 +52,10 @@ var self = window.StyleFix = {
});
// behavior URLs shoudn’t be converted (Issue #19)
- css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + base, 'gi'), '$1');
- }
+ // base should be escaped before added to RegExp (Issue #81)
+ var escaped_base = base.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");
+ css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + escaped_base, 'gi'), '$1');
+ }
var style = document.createElement('style');
style.textContent = css;
Please sign in to comment.
Something went wrong with that request. Please try again.