mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 07:18:43 +00:00
Clean file names for belt and suspenders
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.os.Environment;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import org.thoughtcrime.securesms.database.NoExternalStorageException;
|
||||
|
||||
@@ -49,4 +50,13 @@ public class StorageUtil
|
||||
public static File getDownloadDir() throws NoExternalStorageException {
|
||||
return new File(getSignalStorageDir(), Environment.DIRECTORY_DOWNLOADS);
|
||||
}
|
||||
|
||||
public static @Nullable String getCleanFileName(@Nullable String fileName) {
|
||||
if (fileName == null) return null;
|
||||
|
||||
fileName = fileName.replace('\u202D', '\uFFFD');
|
||||
fileName = fileName.replace('\u202E', '\uFFFD');
|
||||
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user