From 15b175ec7ed0423bc5a58d1306062458ab0b2a04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 9 Nov 2013 00:39:36 +0100 Subject: [PATCH] Always use the correct length of the scheme. --- src/main/java/net/pterodactylus/sone/text/SoneTextParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java index ad4bfff..4f9900a 100644 --- a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java +++ b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java @@ -273,7 +273,7 @@ public class SoneTextParser implements Parser { parts.add(new PlainTextPart(link)); } } else if (linkType.isInternetLink()) { - name = link.substring(linkType == LinkType.HTTP ? 7 : 8); + name = link.substring(linkType.getScheme().length()); int firstSlash = name.indexOf('/'); int lastSlash = name.lastIndexOf('/'); if ((lastSlash - firstSlash) > 3) { -- 2.7.4