From 0ff463ae95199265dc5a2fd692f47af17ae3a0b7 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Mon, 31 Jul 2006 04:56:58 +0000 Subject: [PATCH] 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 --- mod/assignment/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 7fefab7494..a510e7fbe0 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -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); } -- 2.39.5