MDL-47868 ws: verify upload areas

This commit is contained in:
Petr Skoda
2014-11-04 01:48:17 +01:00
committed by Eloy Lafuente (stronk7)
parent 7ee4642bcb
commit 76ae1f6068
+5
View File
@@ -68,6 +68,11 @@ if ($fileuploaddisabled) {
$context = context_user::instance($USER->id);
require_capability('moodle/user:manageownfiles', $context);
if ($filearea !== 'private' and $filearea !== 'draft') {
// Do not dare to allow more areas here!
throw new file_exception('error');
}
$fs = get_file_storage();
$totalsize = 0;