summaryrefslogtreecommitdiffstats
path: root/lib/filecache.php
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-03-09 16:45:57 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-03-09 16:45:57 +0100
commitca9b4e467fe112d45be5454a69d0cba62d1fa660 (patch)
treee6e0944d88e0d4bd636cc26aa500b132b701b3ec /lib/filecache.php
parent84d6c539702db2d0f50ea238c6312f51422bf19a (diff)
downloadnextcloud-server-ca9b4e467fe112d45be5454a69d0cba62d1fa660.tar.gz
nextcloud-server-ca9b4e467fe112d45be5454a69d0cba62d1fa660.zip
filescan by mimetype scan
Diffstat (limited to 'lib/filecache.php')
-rw-r--r--lib/filecache.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/filecache.php b/lib/filecache.php
index 7cea878042d..5d72c4898dc 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -540,14 +540,15 @@ class OC_FileCache{
}elseif($root=='/'){
$root='';
}
- $rootLen=strlen($root);
+ $rootLen=strlen($root);
+ $root .= '%';
$user=OC_User::getUser();
if(!$part2){
- $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimepart=? AND user=?');
- $result=$query->execute(array($part1,$user));
+ $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimepart=? AND user=? AND path LIKE ?');
+ $result=$query->execute(array($part1,$user, $root));
}else{
- $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimetype=? AND user=?');
- $result=$query->execute(array($part1.'/'.$part2,$user));
+ $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimetype=? AND user=? AND path LIKE ? ');
+ $result=$query->execute(array($part1.'/'.$part2,$user, $root));
}
$names=array();
while($row=$result->fetchRow()){