Index: src/org/adblockplus/android/AdblockPlus.java |
diff --git a/src/org/adblockplus/android/AdblockPlus.java b/src/org/adblockplus/android/AdblockPlus.java |
index b77b972713b59e17acaf55ab826333422c28040f..e3c389121ffa80e316df0739f2410945bfb97a69 100755 |
--- a/src/org/adblockplus/android/AdblockPlus.java |
+++ b/src/org/adblockplus/android/AdblockPlus.java |
@@ -58,11 +58,11 @@ public class AdblockPlus extends Application |
{ |
private static final String TAG = Utils.getTag(AdblockPlus.class); |
- private static final Pattern RE_JS = Pattern.compile(".*\\.js$", Pattern.CASE_INSENSITIVE); |
- private static final Pattern RE_CSS = Pattern.compile(".*\\.css$", Pattern.CASE_INSENSITIVE); |
- private static final Pattern RE_IMAGE = Pattern.compile(".*\\.(?:gif|png|jpe?g|bmp|ico)$", Pattern.CASE_INSENSITIVE); |
- private static final Pattern RE_FONT = Pattern.compile(".*\\.(?:ttf|woff)$", Pattern.CASE_INSENSITIVE); |
- private static final Pattern RE_HTML = Pattern.compile(".*\\.html?$", Pattern.CASE_INSENSITIVE); |
+ private static final Pattern RE_JS = Pattern.compile("\\.js$", Pattern.CASE_INSENSITIVE); |
+ private static final Pattern RE_CSS = Pattern.compile("\\.css$", Pattern.CASE_INSENSITIVE); |
+ private static final Pattern RE_IMAGE = Pattern.compile("\\.(?:gif|png|jpe?g|bmp|ico)$", Pattern.CASE_INSENSITIVE); |
+ private static final Pattern RE_FONT = Pattern.compile("\\.(?:ttf|woff)$", Pattern.CASE_INSENSITIVE); |
+ private static final Pattern RE_HTML = Pattern.compile("\\.html?$", Pattern.CASE_INSENSITIVE); |
/** |
* Update notification id. |
@@ -378,15 +378,15 @@ public class AdblockPlus extends Application |
if (contentType == null) |
{ |
- if (RE_JS.matcher(url).matches()) |
+ if (RE_JS.matcher(url).find()) |
contentType = "SCRIPT"; |
- else if (RE_CSS.matcher(url).matches()) |
+ else if (RE_CSS.matcher(url).find()) |
contentType = "STYLESHEET"; |
- else if (RE_IMAGE.matcher(url).matches()) |
+ else if (RE_IMAGE.matcher(url).find()) |
contentType = "IMAGE"; |
- else if (RE_FONT.matcher(url).matches()) |
+ else if (RE_FONT.matcher(url).find()) |
contentType = "FONT"; |
- else if (RE_HTML.matcher(url).matches()) |
+ else if (RE_HTML.matcher(url).find()) |
contentType = "SUBDOCUMENT"; |
} |
if (contentType == null) |