Skip to content

Commit

Permalink
Fix filename generation from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Sep 5, 2015
1 parent bf1a240 commit 4e0d5eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Emoji Switcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 23
versionCode 13
versionName "2.0"
versionCode 14
versionName "2.0.1"
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ public static boolean isDownloaded(EmojiSet emojiSet) throws IOException {
}

private static String filenameFromUrl(String url) {
return FilenameUtils.getName(url);
String filename = FilenameUtils.getName(url);
int indexOfParam = filename.indexOf('?');
if (indexOfParam != -1) {
return filename.substring(0, indexOfParam);
} else {
return filename;
}
}

public static String filePath(Context context, EmojiSetListing listing) {
Expand Down

0 comments on commit 4e0d5eb

Please sign in to comment.