Skip to content

Commit

Permalink
MDL-47868 ws: verify upload areas
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Skoda authored and stronk7 committed Nov 4, 2014
1 parent e133160 commit 2f87351
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webservice/upload.php
Expand Up @@ -68,6 +68,11 @@
$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;
Expand Down

0 comments on commit 2f87351

Please sign in to comment.