diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-18 11:46:40 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-18 11:46:40 +0200 |
commit | ba28e2523ecaecbcdf1a84dd0fac8b8f57a0c675 (patch) | |
tree | 36cfa89a49d1712e9fe099db0b93d5a58831048e /src | |
parent | b9fbc48168dcf23456e86b8dfe045c57a3d56e6d (diff) | |
download | AntennaPod-ba28e2523ecaecbcdf1a84dd0fac8b8f57a0c675.zip |
Fixed #254.
feed:// is now replaced with http://
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/util/URLChecker.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/util/URLChecker.java b/src/de/danoeh/antennapod/util/URLChecker.java index 6d9b8ff03..13668d4a9 100644 --- a/src/de/danoeh/antennapod/util/URLChecker.java +++ b/src/de/danoeh/antennapod/util/URLChecker.java @@ -19,13 +19,12 @@ public final class URLChecker { * */ public static String prepareURL(String url) { StringBuilder builder = new StringBuilder(); - url = url.trim(); - if (!url.startsWith("http")) { + if (url.startsWith("feed://")) { + if (AppConfig.DEBUG) Log.d(TAG, "Replacing feed:// with http://"); + url = url.replace("feed://", "http://"); + } else if (!(url.startsWith("http://") || url.startsWith("https://"))) { + if (AppConfig.DEBUG) Log.d(TAG, "Adding http:// at the beginning of the URL"); builder.append("http://"); - if (AppConfig.DEBUG) Log.d(TAG, "Missing http; appending"); - } else if (url.startsWith("https")) { - if (AppConfig.DEBUG) Log.d(TAG, "Replacing https with http"); - url = url.replaceFirst("https", "http"); } builder.append(url); |