summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-09-23 12:44:11 +0200
committerAndreas Fischer <bantu@owncloud.com>2013-09-23 12:44:11 +0200
commit4a9f1cc74d7323b43983023c2b5b28e550e8c85d (patch)
tree13b09a7b9bc56eaffa3872de0260896b2916ca30 /lib/files
parent2a17025d537c41b9366c9592c985b911d9394337 (diff)
parent9851f0f4f2a97dc6ac1382bcd533eb23feffa4e0 (diff)
downloadnextcloud-server-4a9f1cc74d7323b43983023c2b5b28e550e8c85d.tar.gz
nextcloud-server-4a9f1cc74d7323b43983023c2b5b28e550e8c85d.zip
Merge remote-tracking branch 'owncloud/master' into fixing-4866-master
* owncloud/master: (98 commits) [tx-robot] updated from transifex files: when filtering search results, ensure results are children of the fakeroot not just path starting the same setting a default on filecache column unencrypted_size [tx-robot] updated from transifex remove unneccessary lib in namespace namespaces use upcasefirst parts when _ is left in namespace and files are named after their classes the autoloader will also find classes in the lib folder of an app its magic! initialize variable calculate correct permissions while toggle the password protection make sure that both $permissions and $oldPermissions have the same type Add copyright, remove starting blank line update inherit docs comment Fix insert/update/delete helper functions for oracle Add missing return true statements to legacy preferences functions Add missing static Convert OC_Preference to object interface fix race condition in lazy preview loading use {count} instead of 'One' for more versatile translation fix double translation of error message use n to translate title fixing typos and l10n ... Conflicts: tests/lib/files/cache/scanner.php
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/cache/scanner.php2
-rw-r--r--lib/files/view.php14
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index fcb8ccdc8d5..a986c1ca725 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -133,6 +133,8 @@ class Scanner extends BasicEmitter {
if (!empty($newData)) {
$this->cache->put($file, $newData);
}
+ } else {
+ $this->cache->remove($file);
}
return $data;
}
diff --git a/lib/files/view.php b/lib/files/view.php
index 968b755a661..aa08a5f7cc9 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -500,7 +500,7 @@ class View {
} else {
if ($this->is_dir($path1) && ($dh = $this->opendir($path1))) {
$result = $this->mkdir($path2);
- if(is_resource($dh)) {
+ if (is_resource($dh)) {
while (($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
$result = $this->copy($path1 . '/' . $file, $path2 . '/' . $file);
@@ -975,7 +975,7 @@ class View {
/**
* search for files by mimetype
*
- * @param string $query
+ * @param string $mimetype
* @return array
*/
public function searchByMime($mimetype) {
@@ -998,7 +998,7 @@ class View {
$results = $cache->$method($query);
foreach ($results as $result) {
- if (substr($mountPoint . $result['path'], 0, $rootLength) === $this->fakeRoot) {
+ if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') {
$result['path'] = substr($mountPoint . $result['path'], $rootLength);
$files[] = $result;
}
@@ -1012,9 +1012,11 @@ class View {
$relativeMountPoint = substr($mountPoint, $rootLength);
$results = $cache->$method($query);
- foreach ($results as $result) {
- $result['path'] = $relativeMountPoint . $result['path'];
- $files[] = $result;
+ if ($results) {
+ foreach ($results as $result) {
+ $result['path'] = $relativeMountPoint . $result['path'];
+ $files[] = $result;
+ }
}
}
}