mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fix media URL generation for non-ASCII filenames
Characters in the filename weren't being encoded when generating a URL, which seems to break something in the network fetching. Change-Id: I10a18d1e5e32a4806cdae03b4a510a18eba9802b
This commit is contained in:
parent
fa4a1d06ac
commit
709a820973
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ public class Utils {
|
|||
public static String makeThumbBaseUrl(String filename) {
|
||||
String name = filename.replaceFirst("File:", "").replace(" ", "_");
|
||||
String sha = new String(Hex.encodeHex(DigestUtils.md5(name)));
|
||||
return String.format("%s/%s/%s/%s", CommonsApplication.IMAGE_URL_BASE, sha.substring(0, 1), sha.substring(0, 2), name);
|
||||
return String.format("%s/%s/%s/%s", CommonsApplication.IMAGE_URL_BASE, sha.substring(0, 1), sha.substring(0, 2), urlEncode(name));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue