aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJosh Richards <josh.t.richards@gmail.com>2023-06-03 08:57:38 -0400
committeryemkareems <yemkareems@gmail.com>2024-11-13 08:34:23 +0530
commitce3cec9681c49050c133751eab865183c908291f (patch)
tree326b4bfde2f71775689087e56885421295876ae1 /lib
parent219c508fa3fab2359ac2ef0129d7f7b23c364aba (diff)
downloadnextcloud-server-ce3cec9681c49050c133751eab865183c908291f.tar.gz
nextcloud-server-ce3cec9681c49050c133751eab865183c908291f.zip
fix: Clean-up some remaining readdir calls with undesirable false evaluation potential
Signed-off-by: Josh Richards <josh.t.richards@gmail.com> [skip ci]
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Common.php2
-rw-r--r--lib/private/Files/Storage/PolyFill/CopyDirectory.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index ab9cd5c3326..d2a344a8217 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -232,7 +232,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
$this->remove($target);
$dir = $this->opendir($source);
$this->mkdir($target);
- while ($file = readdir($dir)) {
+ while (($file = readdir($dir)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
if (!$this->copy($source . '/' . $file, $target . '/' . $file)) {
closedir($dir);
diff --git a/lib/private/Files/Storage/PolyFill/CopyDirectory.php b/lib/private/Files/Storage/PolyFill/CopyDirectory.php
index ff05eecb134..c22b9edc592 100644
--- a/lib/private/Files/Storage/PolyFill/CopyDirectory.php
+++ b/lib/private/Files/Storage/PolyFill/CopyDirectory.php
@@ -86,7 +86,7 @@ trait CopyDirectory {
protected function copyRecursive($source, $target) {
$dh = $this->opendir($source);
$result = true;
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
if ($this->is_dir($source . '/' . $file)) {
$this->mkdir($target . '/' . $file);