aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/files/cache/cache.php2
-rwxr-xr-xlib/util.php7
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 3818fdbd840..5b8dc46b771 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -200,7 +200,7 @@ class Cache {
$data['path'] = $file;
$data['parent'] = $this->getParentId($file);
- $data['name'] = basename($file);
+ $data['name'] = \OC_Util::basename($file);
$data['encrypted'] = isset($data['encrypted']) ? ((int)$data['encrypted']) : 0;
list($queryParts, $params) = $this->buildParts($data);
diff --git a/lib/util.php b/lib/util.php
index 1f666a5e37f..b7dc2207e6c 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -894,4 +894,11 @@ class OC_Util {
return $value;
}
+
+ public static function basename($file)
+ {
+ $file = rtrim($file, '/');
+ $t = explode('/', $file);
+ return array_pop($t);
+ }
}