diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-30 08:39:53 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-30 08:39:53 -0700 |
commit | f35aadb5760923a42c8c4395a1dd381faef5251d (patch) | |
tree | 4a1c12df0c44e4260ee9c4d059606dc049361f09 /lib | |
parent | 91318f7b061a39cbb520fdb38ae1156f466738b5 (diff) | |
parent | 409268f3227854dab73233a88a114f26b0fed478 (diff) | |
download | nextcloud-server-f35aadb5760923a42c8c4395a1dd381faef5251d.tar.gz nextcloud-server-f35aadb5760923a42c8c4395a1dd381faef5251d.zip |
Merge pull request #4227 from owncloud/fixing-testGetById-master
implement a platform independent version of basename
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/cache/cache.php | 2 | ||||
-rwxr-xr-x | lib/util.php | 7 |
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); + } } |