Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit df08bae6 authored by Richard Steinmetz's avatar Richard Steinmetz Committed by GitHub
Browse files

Merge pull request #4365 from nextcloud/backport/4359/stable3.4

[stable3.4] Don't rely on guessed mime type on import
parents 916e91b2 58ff01bd
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -166,12 +166,10 @@ export default {
				const size = file.size
				let type = file.type

				// Handle cases where we are running inside a browser on Windows
				//
				// Developers are advised not to rely on the type as a sole validation scheme.
				// https://developer.mozilla.org/en-US/docs/Web/API/File/type
				// "Uncommon" file-extensions will result in an empty type
				// and apparently Microsoft considers calendar files to be "uncommon"
				if (type === '') {
				if (!this.supportedFileTypes.includes(type)) {
					// Try to guess file type based on its extension.
					// If it's an xml file, our best guess is xCal: https://tools.ietf.org/html/rfc6321
					// If it's a json file, our best guess is jCal: https://tools.ietf.org/html/rfc7265
					// In every other case, our best guess is just plain old iCalendar: https://tools.ietf.org/html/rfc5545
@@ -186,15 +184,6 @@ export default {
					}
				}

				// Make sure the user didn't select
				// files of a different file-type
				if (!this.supportedFileTypes.includes(type)) {
					showError(this.$t('calendar', '{filename} is an unsupported file-type', {
						filename: name,
					}))
					continue
				}

				// Use custom-options for parser.
				// The last one in particular will prevent thousands
				// of invitation emails to be sent out on import