Permalink
Browse files

Fixed bug with URL parsing

  • Loading branch information...
1 parent ac14f43 commit 9c8575e60148648d73dd92f1794a867c2a05cd54 @LeaVerou committed Feb 27, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 prefixfree.js
  2. +2 −2 prefixfree.min.js
View
@@ -38,15 +38,15 @@ var self = window.StyleFix = {
// Convert relative URLs to absolute, if needed
if(base) {
- css = css.replace(/url\(('?|"?)(.+?)\1\)/gi, function($0, quote, url) {
+ css = css.replace(/url\(((?:"|')?)(.+?)\1\)/gi, function($0, quote, url) {
if(!/^([a-z]{3,10}:|\/|#)/i.test(url)) { // If url not absolute & not a hash
// May contain sequences like /../ and /./ but those DO work
return 'url("' + base + url + '")';
}
return $0;
});
-
+
// behavior URLs shoudn’t be converted (Issue #19)
css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + base, 'gi'), '$1');
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 9c8575e

Please sign in to comment.