Skip to content

Commit

Permalink
Fix including URL query params as file name when sending an attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
felldo committed Oct 24, 2023
1 parent a28bc2f commit 44ba958
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ public FileContainer(URL file, boolean isSpoiler, String description) {
fileAsUrl = file;
fileAsByteArray = null;
fileAsInputStream = null;
fileTypeOrName = (isSpoiler ? "SPOILER_" : "") + new File(file.getFile()).getName();
fileTypeOrName = (isSpoiler ? "SPOILER_" : "")
+ (null == file.getQuery()
? new File(file.getFile()).getName()
: new File(file.getFile().replace("?" + file.getQuery(), "")).getName());
fileDescription = description;
}

Expand Down

0 comments on commit 44ba958

Please sign in to comment.