Skip to content

Commit

Permalink
fix filename stripping (openhab#2442)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored Jul 31, 2021
1 parent 7d5f95c commit 67d9bf5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ File getUniqueFile(String key) {
*/
@Nullable
String getFileExtension(String fileName) {
String strippedFileName = fileName.replaceFirst("\\?.*$", "");
String strippedFileName = fileName.replaceFirst("\\?.*$", "").replace("/", File.separator);
int extensionPos = strippedFileName.lastIndexOf(EXTENSION_SEPARATOR);
int lastSeparatorPos = strippedFileName.lastIndexOf(File.separator);
return lastSeparatorPos > extensionPos ? null : strippedFileName.substring(extensionPos + 1);
Expand Down

0 comments on commit 67d9bf5

Please sign in to comment.