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 09:11:17 +0530 |
commit | 1fc1543a8bcffa04f0c4d42ba2252409c8876041 (patch) | |
tree | 100e3e14795208077fc7e23245086e3b18cc2938 /tests | |
parent | 0da87f178f1db975a1c3f9212b99ac01f4bae874 (diff) | |
download | nextcloud-server-1fc1543a8bcffa04f0c4d42ba2252409c8876041.tar.gz nextcloud-server-1fc1543a8bcffa04f0c4d42ba2252409c8876041.zip |
fix: Clean-up some remaining readdir calls with undesirable false evaluation potential
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'tests')
-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 0a170a0e7d5..747cb4b6f43 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -66,7 +66,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; } @@ -99,7 +99,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 bc9355d7bfb..ae6a6ece742 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -208,7 +208,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 c48f52ecce7..fb2d05d0691 100644 --- a/tests/lib/Files/Storage/Wrapper/JailTest.php +++ b/tests/lib/Files/Storage/Wrapper/JailTest.php @@ -27,7 +27,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; } |