You are here

function advagg_url_to_filename in Advanced CSS/JS Aggregation 7.2

Given a URL output a filename.

Parameters

string $url: The url.

string $strict: If FALSE then slashes will be kept.

Return value

string The filename.

3 calls to advagg_url_to_filename()
advagg_critical_css_admin_settings_form in advagg_critical_css/advagg_critical_css.admin.inc
Form builder; Configure advagg settings.
advagg_mod_find_critical_css_file in advagg_mod/advagg_mod.module
Try to find the critical css file.
_advagg_relocate_get_urls in advagg_relocate/advagg_relocate.module
Return a filename => url array for external assets.

File

./advagg.module, line 6201
Advanced CSS/JS aggregation module.

Code

function advagg_url_to_filename($url, $strict = TRUE) {

  // Keep filtering till there are no more changes.
  $decoded1 = _advagg_url_to_filename_filter($url, $strict);
  $decoded2 = _advagg_url_to_filename_filter($decoded1, $strict);
  while ($decoded1 != $decoded2) {
    $decoded1 = _advagg_url_to_filename_filter($decoded2, $strict);
    $decoded2 = _advagg_url_to_filename_filter($decoded1, $strict);
  }
  $filename = $decoded1;

  // Shorten filename to a max of 250 characters.
  $filename = mb_strcut($filename, 0, 250, mb_detect_encoding($filename));
  return $filename;
}