COnsistent use of readdir
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user