feed:// is now replaced with http://
This commit is contained in:
daniel oeh 2013-08-18 11:46:40 +02:00
parent b9fbc48168
commit ba28e2523e
1 changed files with 5 additions and 6 deletions

View File

@ -19,13 +19,12 @@ public final class URLChecker {
* */ * */
public static String prepareURL(String url) { public static String prepareURL(String url) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
url = url.trim(); if (url.startsWith("feed://")) {
if (!url.startsWith("http")) { 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://"); 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); builder.append(url);