From 76ae1f6068f63149acc2d8c362af94067f4a227d Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 4 Nov 2014 08:52:26 +1300 Subject: [PATCH] MDL-47868 ws: verify upload areas --- webservice/upload.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webservice/upload.php b/webservice/upload.php index 93310cdf357..03503b274db 100644 --- a/webservice/upload.php +++ b/webservice/upload.php @@ -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;