mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-14 06:57:51 +00:00
desktop: do not suggest file names starting with "<" (#8103)
This commit is contained in:
1 parent
3ff3a124e4
commit
3320b21b1d
2 files changed
+3
-2
No files matched your search
+1
-1
@@ -116,7 +116,7 @@ private fun fileFilterDescription(input: String): String = when(input) {
|
||||
else -> ""
|
||||
}
|
||||
|
||||
internal fun saveDialogFileName(name: String): String = name.trimStart('.').ifEmpty { name }
|
||||
internal fun saveDialogFileName(name: String): String = name.trimStart('.', '<').ifEmpty { name }
|
||||
|
||||
actual fun URI.inputStream(): InputStream? = toFile().inputStream()
|
||||
actual fun URI.outputStream(): OutputStream = toFile().outputStream()
|
||||
+2
-1
@@ -6,9 +6,10 @@ import kotlin.test.assertEquals
|
||||
|
||||
class SaveDialogFileNameTest {
|
||||
@Test
|
||||
fun testLeadingDotsRemoved() {
|
||||
fun testLeadingDotsAndLessThanSignsRemoved() {
|
||||
assertEquals("bashrc", saveDialogFileName(".bashrc"))
|
||||
assertEquals("hidden.txt", saveDialogFileName("..hidden.txt"))
|
||||
assertEquals("notes.txt", saveDialogFileName("<notes.txt"))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user