function field_file_strip_path in FileField 6.3
Same name and namespace in other branches
- 6.2 field_file.inc \field_file_strip_path()
Remove a possible leading file directory path from the given path.
File
- ./
field_file.inc, line 369 - Common functionality for file handling CCK field modules.
Code
function field_file_strip_path($path) {
$dirpath = file_directory_path();
$dirlen = drupal_strlen($dirpath);
if (drupal_substr($path, 0, $dirlen + 1) == $dirpath . '/') {
$path = drupal_substr($path, $dirlen + 1);
}
return $path;
}