aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Geocache.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-03-22 14:48:03 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-03-22 14:48:03 +0100
commit9068fa9fc49620aea9cdf55ac985c4e50b4d8796 (patch)
treef51ce2286056bfa410f9078683b0d42f0f2081a8 /main/src/cgeo/geocaching/Geocache.java
parentdddba45bcc00f12009badc3df7c9ce304c4926fa (diff)
downloadcgeo-9068fa9fc49620aea9cdf55ac985c4e50b4d8796.zip
cgeo-9068fa9fc49620aea9cdf55ac985c4e50b4d8796.tar.gz
cgeo-9068fa9fc49620aea9cdf55ac985c4e50b4d8796.tar.bz2
Do not open images from geocheck.org in external application
Diffstat (limited to 'main/src/cgeo/geocaching/Geocache.java')
-rw-r--r--main/src/cgeo/geocaching/Geocache.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java
index f6e3f18..a03f515 100644
--- a/main/src/cgeo/geocaching/Geocache.java
+++ b/main/src/cgeo/geocaching/Geocache.java
@@ -25,6 +25,7 @@ import cgeo.geocaching.list.StoredList;
import cgeo.geocaching.network.HtmlImage;
import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.utils.CancellableHandler;
+import cgeo.geocaching.utils.ImageUtils;
import cgeo.geocaching.utils.LazyInitializedList;
import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.LogTemplateProvider;
@@ -159,6 +160,10 @@ public class Geocache implements ICache, IWaypoint {
private Handler changeNotificationHandler = null;
+ // Images whose URL contains one of those patterns will not be available on the Images tab
+ // for opening into an external application.
+ private final String[] NO_EXTERNAL = new String[]{"geocheck.org"};
+
/**
* Create a new cache. To be used everywhere except for the GPX parser
*/
@@ -1723,7 +1728,7 @@ public class Geocache implements ICache, IWaypoint {
Html.fromHtml(getDescription(), new ImageGetter() {
@Override
public Drawable getDrawable(final String source) {
- if (!urls.contains(source)) {
+ if (!urls.contains(source) && !ImageUtils.containsPattern(source, NO_EXTERNAL)) {
images.add(new Image(source, geocode));
urls.add(source);
}