Permalink
Browse files

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 <luke@catalyst.net.nz>
  • Loading branch information...
1 parent 51886e2 commit 0ff463ae95199265dc5a2fd692f47af17ae3a0b7 martinlanghoff committed Jul 31, 2006
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/assignment/lib.php
View
@@ -1487,7 +1487,7 @@ function count_user_files($userid) {
$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);
}

0 comments on commit 0ff463a

Please sign in to comment.