mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
"MDL-23407, fixed the problem that firefox trying to download json response"
This commit is contained in:
parent
d44bdfb068
commit
ac1870e330
@ -264,9 +264,17 @@ switch ($action) {
|
||||
}
|
||||
break;
|
||||
case 'upload':
|
||||
// TODO: add file scanning MDL-19380 into each plugin
|
||||
$result = $repo->upload();
|
||||
echo json_encode($result);
|
||||
// handle exception here instead moodle default exception handler
|
||||
// see MDL-23407
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user