function cdn_html_alter_anchor_urls in CDN 7.2
Alter file download URLs.
1 call to cdn_html_alter_anchor_urls()
- cdn_post_render_html_alter in ./
cdn.module - Alter file URLs in the given HTML (currently only image file URLs).
File
- ./
cdn.fallback.inc, line 39 - Fallback when hook_file_url_alter() is not available (i.e. when the core patch is not installed or when not using Pressflow): use the Parallel module's logic (with some adaptations to be able to use the CDN module's logic (in particular:…
Code
function cdn_html_alter_anchor_urls(&$html) {
$url_prefix_regex = _cdn_generate_url_prefix_regex();
$pattern = "#((<a\\s+|<a\\s+[^>]*\\s+)href\\s*=\\s*[\"|'])({$url_prefix_regex})([^\"|^'|^\\?]*)()(\\?[^\"|^']*)?([\"|'])#i";
_cdn_html_alter_file_url($html, $pattern, 0, 4, 6, 1, 7, FALSE, TRUE);
}