summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib_share.php
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-06-26 19:21:24 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-06-26 19:21:24 -0400
commitfe178310f3a229ef1a61fcb9187cca92b82e2cdd (patch)
tree01c3c062b47b03195a77f3316e59daefc6853460 /apps/files_sharing/lib_share.php
parent12c168b6dd277e656e9806179f1519840b0fe605 (diff)
downloadnextcloud-server-fe178310f3a229ef1a61fcb9187cca92b82e2cdd.tar.gz
nextcloud-server-fe178310f3a229ef1a61fcb9187cca92b82e2cdd.zip
Use php functions dirname() and basename() instead of manipulating strings in getSource()
Diffstat (limited to 'apps/files_sharing/lib_share.php')
-rw-r--r--apps/files_sharing/lib_share.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index 6bb36615b18..e64fed6f640 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -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;
}