diff --git a/cdn.basic.css.inc b/cdn.basic.css.inc index 3c1ed2f..8bba66c 100644 --- a/cdn.basic.css.inc +++ b/cdn.basic.css.inc @@ -166,7 +166,7 @@ function _cdn_build_css_path($matches, $base = NULL) { // need to this back in. // See http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax // for more information. - if ($query === '' && strpos($url, '?') !== FALSE) { + if ($query === '' && strpos($url, $scheme . $user . $pass . $host . $port . $path . '?') === 0) { $query = '?'; } $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; diff --git a/tests/cdn.test b/tests/cdn.test index 918c11e..011f68e 100644 --- a/tests/cdn.test +++ b/tests/cdn.test @@ -583,7 +583,9 @@ class CDNCssUrlTestCase extends DrupalWebTestCase { require_once "$cdn_path/$file"; } + // Makes sure the URL components are preserved. function testCssUrl() { + global $base_url; $css_info = array( array( 'type' => 'file', @@ -593,7 +595,7 @@ class CDNCssUrlTestCase extends DrupalWebTestCase { try { // Make sure the URL in the supplied CSS file matches what we expect. // trim() is needed to avoid issues with differences in newlines. - $this->assertEqual(trim(file_get_contents(_cdn_build_css_cache($css_info))), '.home{background:url('. url(drupal_get_path('module', 'cdn'), array('absolute' => TRUE)) . '/tests/css/orig/geo-md-webfont.eot?#iefix);}'); + $this->assertEqual(trim(file_get_contents(_cdn_build_css_cache($css_info))), '.home{background:url('. $base_url . '/' . drupal_get_path('module', 'cdn') . '/tests/css/orig/geo-md-webfont.eot?#iefix);}'); } catch (Exception $exc) { $this->fail($exc); }