mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Use php functions dirname() and basename() instead of manipulating strings in getSource()
This commit is contained in:
parent
12c168b6dd
commit
fe178310f3
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue