make root the default parameter for getAbsolutePath()

remotes/origin/stable45
Björn Schießle 13 years ago
parent a15a99b304
commit a25cf8ba83
  1. 2
      lib/filesystem.php
  2. 5
      lib/filesystemview.php

@ -562,7 +562,7 @@ class OC_Filesystem{
if ($root) { // reduce path to the required part of it (no 'username/files')
$fakeRootView = new OC_FilesystemView($root);
$count = 1;
$path=str_replace(OC_App::getStorage("files")->getAbsolutePath(''), "", $fakeRootView->getAbsolutePath($path), $count);
$path=str_replace(OC_App::getStorage("files")->getAbsolutePath(), "", $fakeRootView->getAbsolutePath($path), $count);
}
$path = self::normalizePath($path);

@ -47,10 +47,7 @@ class OC_FilesystemView {
$this->fakeRoot=$root;
}
public function getAbsolutePath($path) {
if(!$path) {
$path='/';
}
public function getAbsolutePath($path = '/') {
if($path[0]!=='/') {
$path='/'.$path;
}

Loading…
Cancel
Save