1
0
mirror of https://github.com/vector-im/element-android.git synced 2025-08-01 18:06:54 +03:00

#6449 Remove test logging for file name

This commit is contained in:
Christian Rowlands
2024-10-16 10:17:49 -04:00
parent 686ca0512f
commit 11f6987a98

View File

@ -27,12 +27,10 @@ import timber.log.Timber
fun safeFileName(fileName: String?, mimeType: String?): String {
return buildString {
// filename has to be safe for the Android System
Timber.i("ISSUE: FileService: original fileName $fileName")
val result = fileName
?.replace("[\\\\?%*:|\"<>\\s]".toRegex(), "_")
?.takeIf { it.isNotEmpty() }
?: DEFAULT_FILENAME
Timber.i("ISSUE: FileService: safeFileName $result")
append(result)
// Check that the extension is correct regarding the mimeType
val extensionFromMime = mimeType?.let { MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) }