diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-25 20:35:12 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-25 20:35:12 +0200 |
commit | 505a300776a958f4076f923b0966ab13eee3c4b5 (patch) | |
tree | 788ab81f0dbcbf467225aea4d9debdbdc4238d1e | |
parent | c245f5a99fcd0c273de8e86d5496e86d61151d6c (diff) | |
download | nextcloud-server-505a300776a958f4076f923b0966ab13eee3c4b5.tar.gz nextcloud-server-505a300776a958f4076f923b0966ab13eee3c4b5.zip |
we should also normalize on update and search because the database layer will not do this for us
-rw-r--r-- | lib/files/cache/cache.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php index dc5e3e20fc7..1e93cc59c6b 100644 --- a/lib/files/cache/cache.php +++ b/lib/files/cache/cache.php @@ -226,6 +226,17 @@ class Cache { * @param array $data */ public function update($id, array $data) { + + if(isset($data['path'])) { + // normalize path + $data['path'] = $this->normalize($data['path']); + } + + if(isset($data['name'])) { + // normalize path + $data['name'] = $this->normalize($data['name']); + } + list($queryParts, $params) = $this->buildParts($data); $params[] = $id; @@ -418,6 +429,10 @@ class Cache { * @return array of file data */ public function search($pattern) { + + // normalize pattern + $pattern = $this->normalize($pattern); + $query = \OC_DB::prepare(' SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`, `unencrypted_size`, `etag` FROM `*PREFIX*filecache` WHERE `name` LIKE ? AND `storage` = ?' |