diff --git a/love/src/main/java/org/love2d/android/GameActivity.java b/love/src/main/java/org/love2d/android/GameActivity.java index b8ec2296..5487b6c4 100644 --- a/love/src/main/java/org/love2d/android/GameActivity.java +++ b/love/src/main/java/org/love2d/android/GameActivity.java @@ -172,6 +172,9 @@ protected void handleIntent(Intent intent) { filename = pathSegments[pathSegments.length - 1]; } + // Sanitize filename to prevent PhysFS complaining later. + filename = filename.replaceAll("[^a-zA-Z0-9_\\\\-\\\\.]", "_"); + String destination_file = this.getCacheDir().getPath() + "/" + filename; InputStream data = getContentResolver().openInputStream(game);