From c5402f457530577999d1adc1715c76e742ad8aa9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 19 Aug 2013 12:04:53 +0200 Subject: use strict equals in readdir loops to prevent issues with '0' files --- lib/files/storage/common.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/files/storage') 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; -- cgit v1.2.3