protected function DrupalFile6Migration::fixUri in Drupal-to-Drupal data migration 7.2
Field mapping callback: Get the URI relative to the file directory.
Parameters
$uri:
Return value
mixed
File
- d6/
file.inc, line 85 - Implementation of DrupalFileMigration for Drupal 6 sources.
Class
- DrupalFile6Migration
- @file Implementation of DrupalFileMigration for Drupal 6 sources.
Code
protected function fixUri($uri) {
// Try the legacy path, as best we could determine it.
$result = str_replace($this->legacyPath, '', $uri);
if ($result == $uri) {
// That didn't work, so assume the prefix is of the form sites/%/files.
$result = preg_replace('|^sites/[^/]+/files/|i', '', $uri);
}
return $result;
}