summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-23 12:35:47 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-11-23 12:35:47 +0100
commitbe4e92130683e90f98ddcb268067951d1fc32153 (patch)
treecbfd5a2fb036138c57130c8e1ae4a0c6d92f5088 /lib
parent98cdd9885fdb3dfa01ad2d75d942215e4652bb2d (diff)
downloadnextcloud-server-be4e92130683e90f98ddcb268067951d1fc32153.tar.gz
nextcloud-server-be4e92130683e90f98ddcb268067951d1fc32153.zip
Use basename() instead of self implementation
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Cache.php4
-rw-r--r--lib/private/legacy/util.php10
2 files changed, 2 insertions, 12 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index 93af3fcf6b6..cf017c73960 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -259,7 +259,7 @@ class Cache implements ICache {
$data['path'] = $file;
$data['parent'] = $this->getParentId($file);
- $data['name'] = \OC_Util::basename($file);
+ $data['name'] = basename($file);
list($queryParts, $params) = $this->buildParts($data);
$queryParts[] = '`storage`';
@@ -551,7 +551,7 @@ class Cache implements ICache {
}
$sql = 'UPDATE `*PREFIX*filecache` SET `storage` = ?, `path` = ?, `path_hash` = ?, `name` = ?, `parent` = ? WHERE `fileid` = ?';
- $this->connection->executeQuery($sql, array($targetStorageId, $targetPath, md5($targetPath), \OC_Util::basename($targetPath), $newParentId, $sourceId));
+ $this->connection->executeQuery($sql, array($targetStorageId, $targetPath, md5($targetPath), basename($targetPath), $newParentId, $sourceId));
$this->connection->commit();
} else {
$this->moveFromCacheFallback($sourceCache, $sourcePath, $targetPath);
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 2610ec3a7b6..1e9090960c1 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -1408,16 +1408,6 @@ class OC_Util {
}
/**
- * @param boolean|string $file
- * @return string
- */
- public static function basename($file) {
- $file = rtrim($file, '/');
- $t = explode('/', $file);
- return array_pop($t);
- }
-
- /**
* A human readable string is generated based on version and build number
*
* @return string