function sassy_compass__resolve_path in Sassy 7.2
Same name and namespace in other branches
- 7.3 sassy_compass/sassy_compass.module \sassy_compass__resolve_path()
Resolves requires to the compass namespace (eg namespace/css3/border-radius)
1 call to sassy_compass__resolve_path()
- sassy_compass__inline_font_files in extensions/
compass/ functions/ inline_image.inc
File
- extensions/
compass/ sassy_compass.module, line 92
Code
function sassy_compass__resolve_path($file) {
if ($file[0] == '/') {
return $file;
}
if (!($path = realpath($file))) {
$path = SassScriptFunction::$context->node->token->filename;
$path = substr($path, 0, strrpos($path, '/')) . '/';
$path = $path . $file;
$last = '';
while ($path != $last) {
$last = $path;
$path = preg_replace('`(^|/)(?!\\.\\./)([^/]+)/\\.\\./`', '$1', $path);
}
$path = realpath($path);
}
if ($path) {
return $path;
}
return false;
}