diff --git a/files/index.php b/files/index.php index 127939905c5..f81923f38d7 100644 --- a/files/index.php +++ b/files/index.php @@ -665,7 +665,7 @@ function displaydir ($wdir) { $fullpath = $basedir.$wdir; $directory = opendir($fullpath); // Find all files - while (($file = readdir($directory)) !== false) { + while (false !== ($file = readdir($directory))) { if ($file == "." || $file == "..") { continue; } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b4651f84928..4c2e8255739 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -4486,7 +4486,7 @@ function get_list_of_plugins($plugin='mod', $exclude='') { global $CFG; $basedir = opendir($CFG->dirroot .'/'. $plugin); - while ($dir = readdir($basedir)) { + while (false !== ($dir = readdir($basedir))) { $firstchar = substr($dir, 0, 1); if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf' or $dir == $exclude) { continue;