diff options
-rw-r--r-- | main/src/cgeo/geocaching/utils/CheckerUtils.java | 3 | ||||
-rw-r--r-- | tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/utils/CheckerUtils.java b/main/src/cgeo/geocaching/utils/CheckerUtils.java index 956ebbf..39ef078 100644 --- a/main/src/cgeo/geocaching/utils/CheckerUtils.java +++ b/main/src/cgeo/geocaching/utils/CheckerUtils.java @@ -2,6 +2,7 @@ package cgeo.geocaching.utils; import cgeo.geocaching.Geocache; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; @@ -25,7 +26,7 @@ public final class CheckerUtils { final String url = matcher.group(); for (final String checker : CHECKERS) { if (StringUtils.containsIgnoreCase(url, checker)) { - return url; + return StringEscapeUtils.unescapeHtml4(url); } } } diff --git a/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java b/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java index 70cf888..fa7c7e7 100644 --- a/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java +++ b/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java @@ -13,6 +13,7 @@ public class CheckerUtilsTest extends TestCase { assertUrl("<p style=\"text-align:center;\"><a href=\"http://google.com/geo_inputchkcoord.php?gid=618932716cc7e68-c4bb-4f41-8bb1-3e0a3e374a1f\" target=\"_blank\"><img", null); assertUrl("http://www.certitudes.org/certitude?wp=GC5MVX7", "http://www.certitudes.org/certitude?wp=GC5MVX7"); assertUrl("http://geochecker.com/index.php?code=e001928e3c2682ec2bae0f24b9d02cfb&action=check&wp=474350573454&name=47656f636865636b6572205465737420666f72204e33382030302e303030205737362030302e303030", "http://geochecker.com/index.php?code=e001928e3c2682ec2bae0f24b9d02cfb&action=check&wp=474350573454&name=47656f636865636b6572205465737420666f72204e33382030302e303030205737362030302e303030"); + assertUrl("<p>Haarige Aussichten gibt es <a href=\"http://www.geochecker.com/index.php?code=cd52752a8649c5e385a624b5341176f9&action=check&wp=4743314a43384b&name=4b61747a656e&language=German\">hier</a>.</p></span>", "http://www.geochecker.com/index.php?code=cd52752a8649c5e385a624b5341176f9&action=check&wp=4743314a43384b&name=4b61747a656e&language=German"); } private static void assertUrl(final String description, final String expected) { |