Strip user-ID prefix from content authority in isValidExternalUri.

This commit is contained in:
Greyson Parrelli
2026-07-15 16:43:47 -04:00
parent 7f63af659d
commit 0d0b9d345c
2 changed files with 8 additions and 1 deletions
@@ -32,7 +32,10 @@ object UriUtil {
}
} else if (ContentResolver.SCHEME_CONTENT == uri.scheme) {
val authority = uri.authority ?: return false
return !authority.startsWith(context.packageName)
// Protect against URI's like "content://0@org.thoughtcrime.securesms.part/..."
val normalizedAuthority = authority.substringAfterLast('@')
return !normalizedAuthority.startsWith(context.packageName)
} else {
return true
}