MOBILE-3213 core: Handle anchors when cleaning extensions

main
Dani Palou 2019-12-17 16:04:47 +01:00
parent c485afee02
commit 82c0385fe5
1 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,13 @@ export class CoreMimetypeUtilsProvider {
}
// If the extension has parameters, remove them.
const position = extension.indexOf('?');
let position = extension.indexOf('?');
if (position > -1) {
extension = extension.substr(0, position);
}
// If the extension has an anchor, remove it.
position = extension.indexOf('#');
if (position > -1) {
extension = extension.substr(0, position);
}