aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-08-16 12:43:53 +0200
committerGitHub <noreply@github.com>2024-08-16 12:43:53 +0200
commitd94073de9226b55c4b64b6b37d2a2b5b22d7ee65 (patch)
treea6c9ead8cb67af6bbd35d5bada89b8adfafe512c /lib
parentb8b81254f302302c2e5344fe35f71c920a2dd476 (diff)
parentd35c4eb911f2eae21e9a7cd0bad89c60e30fda25 (diff)
downloadnextcloud-server-d94073de9226b55c4b64b6b37d2a2b5b22d7ee65.tar.gz
nextcloud-server-d94073de9226b55c4b64b6b37d2a2b5b22d7ee65.zip
Merge pull request #38630 from joshtrichards/jr-readdir-false-false
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 a8f8c05ab54..823ff65474b 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -191,7 +191,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 4b3e367da78..5fe396d97e1 100644
--- a/lib/private/Files/Storage/PolyFill/CopyDirectory.php
+++ b/lib/private/Files/Storage/PolyFill/CopyDirectory.php
@@ -70,7 +70,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);