Given a URL output a filename.
Paramètres
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 dans advagg_critical_css/
advagg_critical_css.admin.inc - Form builder; Configure advagg settings.
- advagg_mod_find_critical_css_file dans advagg_mod/
advagg_mod.module - Try to find the critical css file.
- _advagg_relocate_get_urls dans advagg_relocate/
advagg_relocate.module - Return a filename => url array for external assets.
Fichier
-
./
advagg.module, line 6203
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;
}