mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
"MDL-23407, fixed the problem that firefox trying to download json response"
This commit is contained in:
parent
d44bdfb068
commit
ac1870e330
1 changed files with 11 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue