You are here

function cdn_html_alter_css_urls in CDN 6.2

Alter CSS file URLs in a piece of HTML.

1 call to cdn_html_alter_css_urls()
cdn_preprocess_page in ./cdn.fallback.inc
Implementation of template_preprocess_page().

File

./cdn.fallback.inc, line 58
Fallback when hook_file_url_alter() is not available (i.e. when the core patch is not installed or when not using a patched Drupal distribution): use the Parallel module's logic (with some adaptations to be able to use the CDN module's logic…

Code

function cdn_html_alter_css_urls(&$html) {
  $url_prefix_regex = _cdn_generate_url_prefix_regex();
  $pattern = "#href=\"(({$url_prefix_regex})(.*?\\.css)(\\?.*)?)\"#";
  _cdn_html_alter_file_url($html, $pattern, 0, 3, 4, 'href="', '"');
}