summaryrefslogtreecommitdiffstats
path: root/lib/filesystem.php
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-06-09 15:26:26 +0200
committerBartek Przybylski <bart.p.pl@gmail.com>2012-06-09 15:26:26 +0200
commit43501309e336ac0268b6e9b4b3c6f5b0f05f7056 (patch)
treef596c1a65b537769ba874e721fd54e6af12eb9d6 /lib/filesystem.php
parent120997112c7acf490171d07ec32cdd6d091db9c2 (diff)
downloadnextcloud-server-43501309e336ac0268b6e9b4b3c6f5b0f05f7056.tar.gz
nextcloud-server-43501309e336ac0268b6e9b4b3c6f5b0f05f7056.zip
add function in filesystem to strip webroot
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r--lib/filesystem.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 337b0f1464b..454bb1aa81a 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -344,6 +344,20 @@ class OC_Filesystem{
}
/**
+ * return path to file which reflects one visible in browser
+ * @param string path
+ * @return string
+ */
+ static public function getLocalPath($path) {
+ $datadir = \OCP\Config::getSystemValue('datadirectory').'/'.\OC_User::getUser().'/files';
+ $newpath = $path;
+ if (strncmp($newpath, $datadir, strlen($datadir)) == 0) {
+ $newpath = substr($path, strlen($datadir));
+ }
+ return $newpath;
+ }
+
+ /**
* check if the requested path is valid
* @param string path
* @return bool