Ensure that query/fragment/etc. don't get embedded into local filenames (#989)

when downloading #886
main
Levi Bard 6 years ago committed by Konrad Pozniak
parent 1ef9baad93
commit 5842a57f1d
  1. 3
      app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt

@ -209,8 +209,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE)
} else {
val url = attachments!![viewPager.currentItem].attachment.url
val filename = File(url).name
val filename = Uri.parse(url).lastPathSegment
val toastText = String.format(resources.getString(R.string.download_image), filename)
Toast.makeText(applicationContext, toastText, Toast.LENGTH_SHORT).show()

Loading…
Cancel
Save