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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue