fix relative url detection (#699)

This commit is contained in:
Athou
2015-01-12 09:56:34 +01:00
parent 90e680d6be
commit c81cc8bea4
2 changed files with 9 additions and 6 deletions

View File

@@ -430,12 +430,8 @@ public class FeedUtils {
}
public static boolean isRelative(final String url) {
// the regex means "doesn't start with 'scheme://'"
if ((url != null) && (url.startsWith("/") == false) && (!url.matches("^\\w+\\:\\/\\/.*")) && !(url.startsWith("#"))) {
return true;
} else {
return false;
}
// the regex means "start with 'scheme://'"
return url.startsWith("/") || url.startsWith("#") || !url.matches("^\\w+\\:\\/\\/.*");
}
public static String getFaviconUrl(FeedSubscription subscription, String publicUrl) {