aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2013-02-05 18:43:55 +0000
committerSam Tuke <samtuke@owncloud.com>2013-02-05 18:43:55 +0000
commit3b9e2f1babd578312377f846b2da4d30b550c37f (patch)
tree6f965d04be8ac4a30f029c08aa7f147f1d0fb449 /lib/files
parenta528f96b842e387f153e4f38d87aebd26ccd39b7 (diff)
parente6400b305987977d867f1592f3231167903b70b1 (diff)
downloadnextcloud-server-3b9e2f1babd578312377f846b2da4d30b550c37f.tar.gz
nextcloud-server-3b9e2f1babd578312377f846b2da4d30b550c37f.zip
Merge branch 'master' into files_encryption-style-fixes
Conflicts: apps/files_encryption/lib/crypt.php apps/files_encryption/lib/keymanager.php
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/filesystem.php13
-rw-r--r--lib/files/storage/temporary.php4
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 65d9ffab485..71bf3d8708d 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -527,8 +527,7 @@ class Filesystem {
}
/**
- * normalize a path
- *
+ * @brief Fix common problems with a file path
* @param string $path
* @param bool $stripTrailingSlash
* @return string
@@ -537,21 +536,21 @@ class Filesystem {
if ($path == '') {
return '/';
}
-//no windows style slashes
+ //no windows style slashes
$path = str_replace('\\', '/', $path);
-//add leading slash
+ //add leading slash
if ($path[0] !== '/') {
$path = '/' . $path;
}
-//remove duplicate slashes
+ //remove duplicate slashes
while (strpos($path, '//') !== false) {
$path = str_replace('//', '/', $path);
}
-//remove trailing slash
+ //remove trailing slash
if ($stripTrailingSlash and strlen($path) > 1 and substr($path, -1, 1) === '/') {
$path = substr($path, 0, -1);
}
-//normalize unicode if possible
+ //normalize unicode if possible
if (class_exists('Normalizer')) {
$path = \Normalizer::normalize($path);
}
diff --git a/lib/files/storage/temporary.php b/lib/files/storage/temporary.php
index ffc55e27507..542d2cd9f48 100644
--- a/lib/files/storage/temporary.php
+++ b/lib/files/storage/temporary.php
@@ -9,11 +9,11 @@
namespace OC\Files\Storage;
/**
- * local storage backnd in temporary folder for testing purpores
+ * local storage backend in temporary folder for testing purpose
*/
class Temporary extends Local{
public function __construct($arguments) {
- $this->datadir=\OC_Helper::tmpFolder();
+ parent::__construct(array('datadir' => \OC_Helper::tmpFolder()));
}
public function cleanUp() {