summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-08-20 01:17:25 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-08-20 01:17:25 -0700
commit884c6b5a82fb13c8f2b4fd029b5a16d41e5fc602 (patch)
tree92ce39d6d8b720adf003b5e4c074812f2ffd582d /apps
parente9644c2f52270aa1a1f345ed38bb2e66a4e8752d (diff)
parentcbeccb2fcd3d3d445726c9e0cd5b8e6c8285a1ea (diff)
downloadnextcloud-server-884c6b5a82fb13c8f2b4fd029b5a16d41e5fc602.tar.gz
nextcloud-server-884c6b5a82fb13c8f2b4fd029b5a16d41e5fc602.zip
Merge pull request #4512 from owncloud/readdir-strict-equals
use strict equals in readdir loops to prevent issues with '0' files
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/amazons3.php4
-rw-r--r--apps/files_external/lib/google.php2
-rw-r--r--apps/files_external/lib/irods.php2
-rw-r--r--apps/files_external/lib/smb.php2
-rw-r--r--apps/files_trashbin/index.php2
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 3ce3c38389b..215bdcda6c2 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);