diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-02-11 12:59:23 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-02-11 12:59:23 +0100 |
commit | f223ab796b8b6da796321502e8eeffed81973629 (patch) | |
tree | 7a4674f4f6d4038fd34b83b5d038dc88758312a3 /lib/files/mapper.php | |
parent | 8174e5faf18fcd762efce5ffdfabfa1102580dd5 (diff) | |
parent | 0708f4dec058e98f9d2163000847bf3bc3877faf (diff) | |
download | nextcloud-server-f223ab796b8b6da796321502e8eeffed81973629.tar.gz nextcloud-server-f223ab796b8b6da796321502e8eeffed81973629.zip |
Merge branch 'master' into mapped-storage-unit-testing-linux-master
Diffstat (limited to 'lib/files/mapper.php')
-rw-r--r-- | lib/files/mapper.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/files/mapper.php b/lib/files/mapper.php index 90e4e1ca669..71b665e49bb 100644 --- a/lib/files/mapper.php +++ b/lib/files/mapper.php @@ -114,8 +114,8 @@ class Mapper private function resolveLogicPath($logicPath) { $logicPath = $this->stripLast($logicPath); - $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `logic_path` = ?'); - $result = $query->execute(array($logicPath)); + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?'); + $result = $query->execute(array(md5($logicPath))); $result = $result->fetchRow(); return $result['physic_path']; @@ -123,8 +123,8 @@ class Mapper private function resolvePhysicalPath($physicalPath) { $physicalPath = $this->stripLast($physicalPath); - $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path` = ?'); - $result = $query->execute(array($physicalPath)); + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path_hash` = ?'); + $result = $query->execute(array(md5($physicalPath))); $result = $result->fetchRow(); return $result['logic_path']; @@ -151,8 +151,8 @@ class Mapper } private function insert($logicPath, $physicalPath) { - $query = \OC_DB::prepare('INSERT INTO `*PREFIX*file_map`(`logic_path`,`physic_path`) VALUES(?,?)'); - $query->execute(array($logicPath, $physicalPath)); + $query = \OC_DB::prepare('INSERT INTO `*PREFIX*file_map`(`logic_path`, `physic_path`, `logic_path_hash`, `physic_path_hash`) VALUES(?, ?, ?, ?)'); + $query->execute(array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath))); } private function slugifyPath($path, $index=null) { |