diff options
author | Josh Richards <josh.t.richards@gmail.com> | 2023-06-03 08:57:38 -0400 |
---|---|---|
committer | yemkareems <yemkareems@gmail.com> | 2024-11-13 08:34:23 +0530 |
commit | ce3cec9681c49050c133751eab865183c908291f (patch) | |
tree | 326b4bfde2f71775689087e56885421295876ae1 /tests/lib | |
parent | 219c508fa3fab2359ac2ef0129d7f7b23c364aba (diff) | |
download | nextcloud-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 'tests/lib')
-rw-r--r-- | tests/lib/Files/Storage/Storage.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/EncodingTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/JailTest.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php index 63b3dfc5a98..7e9af719797 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -81,7 +81,7 @@ abstract class Storage extends \Test\TestCase { $dh = $this->instance->opendir('/'); $content = []; - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file != '.' and $file != '..') { $content[] = $file; } @@ -114,7 +114,7 @@ abstract class Storage extends \Test\TestCase { $dh = $this->instance->opendir('/'); $content = []; - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file != '.' and $file != '..') { $content[] = $file; } diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php index 0901edf83fa..3f14ec64995 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -209,7 +209,7 @@ class EncodingTest extends \Test\Files\Storage\Storage { $dh = $this->instance->opendir('/test'); $content = []; - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if ($file != '.' and $file != '..') { $content[] = $file; } diff --git a/tests/lib/Files/Storage/Wrapper/JailTest.php b/tests/lib/Files/Storage/Wrapper/JailTest.php index 148bd3a4f30..01fd67ddfb8 100644 --- a/tests/lib/Files/Storage/Wrapper/JailTest.php +++ b/tests/lib/Files/Storage/Wrapper/JailTest.php @@ -28,7 +28,7 @@ class JailTest extends \Test\Files\Storage\Storage { // test that nothing outside our jail is touched $contents = []; $dh = $this->sourceStorage->opendir(''); - while ($file = readdir($dh)) { + while (($file = readdir($dh)) !== false) { if (!\OC\Files\Filesystem::isIgnoredDir($file)) { $contents[] = $file; } |