Skip to content

Commit

Permalink
Fix crash when exporting a deck with a name containing a path separat…
Browse files Browse the repository at this point in the history
…or (ankidroid#14195)

* Fix crash when exporting a deck with a name containing a path separator

* Update AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt

---------

Co-authored-by: Brayan Oliveira <[email protected]>
  • Loading branch information
lukstbit and BrayanDSO authored Aug 7, 2023
1 parent 1fdf8fb commit 6861e68
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class ActivityExportingDelegate(private val activity: AnkiActivity, private val
}

override fun exportDeckAsApkg(path: String?, did: DeckId, includeSched: Boolean, includeMedia: Boolean) {
val deckName = collectionSupplier.get().decks.name(did)
// files can't have `/` in their names
val deckName = collectionSupplier.get().decks.name(did).replace("/", "_")
val exportPath = getExportFileName(path, deckName, includeSched)

if (BackendFactory.defaultLegacySchema) {
Expand Down

0 comments on commit 6861e68

Please sign in to comment.