You are here

function _filefield_paths_strip_path in File (Field) Paths 5

Same name and namespace in other branches
  1. 6 filefield_paths.module \_filefield_paths_strip_path()
1 call to _filefield_paths_strip_path()
filefield_paths_file_move in ./filefield_paths.module
Move file and update its database record.

File

./filefield_paths.module, line 640
Adds extra functionality to FileFields Path settings.

Code

function _filefield_paths_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;
}