Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 3ad4a1097b5d6c6362efcc49a0627e5f9446b278 1 parent 21c2f2e
martinlanghoff authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  mod/assignment/lib.php
View
2  mod/assignment/lib.php
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.