From 4fad525359d6b3326168aba44297f574cdeaac90 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Thu, 24 May 2018 15:30:18 +0300 Subject: [PATCH] Fixed missing header images for some articles --- .../src/net/osmand/plus/wikivoyage/data/TravelArticle.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java index e84b41be28..58c384bf29 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java @@ -8,6 +8,8 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.Size; import android.text.TextUtils; +import android.util.Log; + import net.osmand.plus.GPXUtilities.GPXFile; import org.apache.commons.codec.binary.Hex; @@ -102,6 +104,7 @@ public class TravelArticle { @NonNull public static String getImageUrl(@NonNull String imageTitle, boolean thumbnail) { + imageTitle = imageTitle.replace(" ", "_"); try { imageTitle = URLDecoder.decode(imageTitle, "UTF-8"); } catch (UnsupportedEncodingException e) { @@ -120,7 +123,7 @@ public class TravelArticle { @Size(2) @NonNull private static String[] getHash(@NonNull String s) { - String md5 = new String(Hex.encodeHex(DigestUtils.md5(s.replace(" ", "_")))); + String md5 = new String(Hex.encodeHex(DigestUtils.md5(s))); return new String[]{md5.substring(0, 1), md5.substring(0, 2)}; } }