diff --git a/user/files_form.php b/user/files_form.php
index <HASH>..<HASH> 100644
--- a/user/files_form.php
+++ b/user/files_form.php
@@ -36,6 +36,7 @@ class user_files_form extends moodleform {
 
         $mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
         $mform->addElement('hidden', 'returnurl', $data->returnurl);
+        $mform->setType('returnurl', PARAM_LOCALURL);
 
         $this->add_action_buttons(true, get_string('savechanges'));
MDL-<I> Repositories: missing call to setType in 'My private files' form