mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 16:25:05 +01:00
get last part after "/" also for content uris
note that this doesn't prevent path traversal as uris can be decoded Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
74e2108ef3
commit
d49441e036
@ -149,11 +149,13 @@ object FileUtils {
|
||||
// if it was no content uri, read filename from path
|
||||
if (filename == null) {
|
||||
filename = uri.path
|
||||
val lastIndexOfSlash = filename!!.lastIndexOf('/')
|
||||
if (lastIndexOfSlash != -1) {
|
||||
filename = filename.substring(lastIndexOfSlash + 1)
|
||||
}
|
||||
}
|
||||
|
||||
val lastIndexOfSlash = filename!!.lastIndexOf('/')
|
||||
if (lastIndexOfSlash != -1) {
|
||||
filename = filename.substring(lastIndexOfSlash + 1)
|
||||
}
|
||||
|
||||
return filename
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user