mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-06 05:14:50 +01:00
Reject dot-only chat names to prevent zip-slip in plaintext export.
This commit is contained in:
+2
-1
@@ -435,7 +435,8 @@ object PlaintextExportRepository {
|
||||
|
||||
@VisibleForTesting
|
||||
internal fun sanitizeFileName(name: String): String {
|
||||
return name.replace(Regex("[\\\\/:*?\"<>|]"), "_").trim().take(100)
|
||||
val sanitized = name.replace(Regex("[\\\\/:*?\"<>|]"), "_").trim().take(100)
|
||||
return if (sanitized.isEmpty() || sanitized.all { it == '.' }) "chat" else sanitized
|
||||
}
|
||||
|
||||
private fun <T> ExecutorService.submitTyped(callable: Callable<T>): Future<T> {
|
||||
|
||||
Reference in New Issue
Block a user