Use php functions dirname() and basename() instead of manipulating strings in getSource()

This commit is contained in:
Michael Gapczynski 2011-06-26 19:21:24 -04:00
parent 12c168b6dd
commit fe178310f3
1 changed files with 2 additions and 2 deletions

View File

@ -88,10 +88,10 @@ class OC_SHARE {
return $result[0]['source'];
} else {
// Check if the directory above this target is shared
$parentDir = substr($target, 0, strrpos($target, "/"));
$parentDir = dirname($target);
if ($parentDir) {
$result = OC_SHARE::getSource($parentDir);
return $result.substr($target, strrpos($target, "/"));
return $result."/".basename($target);
} else {
return false;
}