You've already forked element-android
mirror of
https://github.com/vector-im/element-android.git
synced 2025-08-06 03:42:41 +03:00
#6449 Remove test logging for file name
This commit is contained in:
@@ -27,12 +27,10 @@ import timber.log.Timber
|
|||||||
fun safeFileName(fileName: String?, mimeType: String?): String {
|
fun safeFileName(fileName: String?, mimeType: String?): String {
|
||||||
return buildString {
|
return buildString {
|
||||||
// filename has to be safe for the Android System
|
// filename has to be safe for the Android System
|
||||||
Timber.i("ISSUE: FileService: original fileName $fileName")
|
|
||||||
val result = fileName
|
val result = fileName
|
||||||
?.replace("[\\\\?%*:|\"<>\\s]".toRegex(), "_")
|
?.replace("[\\\\?%*:|\"<>\\s]".toRegex(), "_")
|
||||||
?.takeIf { it.isNotEmpty() }
|
?.takeIf { it.isNotEmpty() }
|
||||||
?: DEFAULT_FILENAME
|
?: DEFAULT_FILENAME
|
||||||
Timber.i("ISSUE: FileService: safeFileName $result")
|
|
||||||
append(result)
|
append(result)
|
||||||
// Check that the extension is correct regarding the mimeType
|
// Check that the extension is correct regarding the mimeType
|
||||||
val extensionFromMime = mimeType?.let { MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) }
|
val extensionFromMime = mimeType?.let { MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) }
|
||||||
|
Reference in New Issue
Block a user