Skip to content

Commit 75ec5d7

Browse files
committed
MOBILE-1701 fs: Fix getExtension for old Moodles
1 parent 41b3b64 commit 75ec5d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

www/core/lib/fs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,11 @@ angular.module('mm.core')
939939
* @return {String} Extension.
940940
*/
941941
self.getExtension = function(mimetype, url) {
942+
if (mimetype == 'application/x-forcedownload' || mimetype == 'application/forcedownload') {
943+
// Couldn't get the right mimetype (old Moodle), try to guess it.
944+
return $mmText.guessExtensionFromUrl(url);
945+
}
946+
942947
var extensions = mimeToExt[mimetype];
943948
if (extensions && extensions.length) {
944949
if (extensions.length > 1 && url) {

0 commit comments

Comments
 (0)