"MDL-23407, fixed the problem that firefox trying to download json response"

This commit is contained in:
Dongsheng Cai 2010-07-20 03:21:11 +00:00
parent d44bdfb068
commit ac1870e330

View file

@ -264,9 +264,17 @@ switch ($action) {
} }
break; break;
case 'upload': case 'upload':
// TODO: add file scanning MDL-19380 into each plugin // handle exception here instead moodle default exception handler
$result = $repo->upload(); // see MDL-23407
echo json_encode($result); try {
// TODO: add file scanning MDL-19380 into each plugin
$result = $repo->upload();
echo json_encode($result);
} catch (Exception $e) {
$err->error = $e->getMessage();
echo json_encode($err);
die;
}
break; break;
} }