MDL-47868 ws: verify upload areas

This commit is contained in:
Petr Skoda
2014-11-04 01:50:27 +01:00
committed by Eloy Lafuente (stronk7)
parent b35be396ff
commit ea1fbc0028
+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;