diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-08-19 12:04:53 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-08-19 12:04:53 +0200 |
commit | c5402f457530577999d1adc1715c76e742ad8aa9 (patch) | |
tree | 85b40240d914a51513940c14179fdecdcb78ad4c /lib/files/storage | |
parent | a1d5aba5fd3795a6ee4a87c96abf0d35d3f8116d (diff) | |
download | nextcloud-server-c5402f457530577999d1adc1715c76e742ad8aa9.tar.gz nextcloud-server-c5402f457530577999d1adc1715c76e742ad8aa9.zip |
use strict equals in readdir loops to prevent issues with '0' files
Diffstat (limited to 'lib/files/storage')
-rw-r--r-- | lib/files/storage/common.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index 3da13ac4df0..1a273240eeb 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -142,7 +142,7 @@ abstract class Common implements \OC\Files\Storage\Storage { return false; } else { $directoryHandle = $this->opendir($directory); - while ($contents = readdir($directoryHandle)) { + while (($contents = readdir($directoryHandle)) !== false) { if (!\OC\Files\Filesystem::isIgnoredDir($contents)) { $path = $directory . '/' . $contents; if ($this->is_dir($path)) { @@ -225,7 +225,7 @@ abstract class Common implements \OC\Files\Storage\Storage { private function addLocalFolder($path, $target) { if ($dh = $this->opendir($path)) { - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file !== '.' and $file !== '..') { if ($this->is_dir($path . '/' . $file)) { mkdir($target . '/' . $file); @@ -243,7 +243,7 @@ abstract class Common implements \OC\Files\Storage\Storage { $files = array(); $dh = $this->opendir($dir); if ($dh) { - while ($item = readdir($dh)) { + while (($item = readdir($dh)) !== false) { if ($item == '.' || $item == '..') continue; if (strstr(strtolower($item), strtolower($query)) !== false) { $files[] = $dir . '/' . $item; |