Same name in other branches
- 7.x-2.x advagg.module \advagg_convert_abs_to_rel()
Converts absolute paths to be self references.
Paramètres
string $path: Path to check.
Return value
string The path.
Fichier
-
./
advagg.module, line 618
Code
function advagg_convert_abs_to_rel($path) {
if (strpos($path, $GLOBALS['base_url']) === 0) {
$base_url = $GLOBALS['base_url'];
// Add a slash if none is found.
if (stripos(strrev($base_url), '/') !== 0) {
$base_url .= '/';
}
$path = str_replace($base_url, $GLOBALS['base_path'], $path);
}
return $path;
}