Use php functions dirname() and basename() instead of manipulating strings in getSource()
This commit is contained in:
parent
12c168b6dd
commit
fe178310f3
|
@ -88,10 +88,10 @@ class OC_SHARE {
|
||||||
return $result[0]['source'];
|
return $result[0]['source'];
|
||||||
} else {
|
} else {
|
||||||
// Check if the directory above this target is shared
|
// Check if the directory above this target is shared
|
||||||
$parentDir = substr($target, 0, strrpos($target, "/"));
|
$parentDir = dirname($target);
|
||||||
if ($parentDir) {
|
if ($parentDir) {
|
||||||
$result = OC_SHARE::getSource($parentDir);
|
$result = OC_SHARE::getSource($parentDir);
|
||||||
return $result.substr($target, strrpos($target, "/"));
|
return $result."/".basename($target);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue