assignment: count_user_files() no longer creates extraneous dirs (bug#4658)

Applied the fix by Samuli.Karevaara, from the bug report - the directory is checked for existence beforehand.
Previously it was created if it didn't exist, then the files within it were counted.


Author: Luke Hudson <[email protected]>
This commit is contained in:
martinlanghoff
2006-07-31 04:56:58 +00:00
parent 51886e2fb4
commit 0ff463ae95
+1 -1
View File
@@ -1487,7 +1487,7 @@ class assignment_base {
$filearea = $this->file_area_name($userid);
if ($basedir = $this->file_area($userid)) {
if ( is_dir($filearea) && $basedir = $this->file_area($userid)) {
if ($files = get_directory_list($basedir)) {
return count($files);
}