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 /apps | |
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 'apps')
-rw-r--r-- | apps/files_external/lib/amazons3.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/google.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/irods.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/smb.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/index.php | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 9363a350e27..2d7bcd4ac37 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -183,7 +183,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { } $dh = $this->opendir($path); - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file === '.' || $file === '..') { continue; } @@ -464,7 +464,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { } $dh = $this->opendir($path1); - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file === '.' || $file === '..') { continue; } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index e6cdacdec4f..b27b9ae3f32 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -206,7 +206,7 @@ class Google extends \OC\Files\Storage\Common { public function rmdir($path) { if (trim($path, '/') === '') { $dir = $this->opendir($path); - while ($file = readdir($dir)) { + while (($file = readdir($dh)) !== false) { if (!\OC\Files\Filesystem::isIgnoredDir($file)) { if (!$this->unlink($path.'/'.$file)) { return false; diff --git a/apps/files_external/lib/irods.php b/apps/files_external/lib/irods.php index a343ac5fb27..7ec3b3a0cfc 100644 --- a/apps/files_external/lib/irods.php +++ b/apps/files_external/lib/irods.php @@ -137,7 +137,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ private function collectionMTime($path) { $dh = $this->opendir($path); $lastCTime = $this->filemtime($path); - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file != '.' and $file != '..') { $time = $this->filemtime($file); if ($time > $lastCTime) { diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 81a6c956385..dc4e02731f1 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -99,7 +99,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ private function shareMTime() { $dh=$this->opendir(''); $lastCtime=0; - while($file=readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file!='.' and $file!='..') { $ctime=$this->filemtime($file); if ($ctime>$lastCtime) { diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 2dbaefe7a78..27f8407db06 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -23,7 +23,7 @@ if ($dir) { $dirlisting = true; $dirContent = $view->opendir($dir); $i = 0; - while($entryName = readdir($dirContent)) { + while(($entryName = readdir($dirContent)) !== false) { if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) { $pos = strpos($dir.'/', '/', 1); $tmp = substr($dir, 0, $pos); |