Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java |
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java |
index 93611101a97382b42a3dc8f75e682bc741c5a103..79c5a8692c40a6fda04d6e9c7d88b7034c846ec2 100644 |
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java |
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java |
@@ -136,4 +136,14 @@ public final class Utils |
} |
} |
} |
+ |
+ public static String getUrlWithoutParams(String urlWithParams) |
+ { |
+ if (urlWithParams == null) { |
Felix Dahlke
2017/05/09 08:10:49
Nit: Opening brace should go on its own line.
anton
2017/05/10 07:46:53
Acknowledged.
|
+ throw new IllegalArgumentException("URL can't be null"); |
+ } |
+ |
+ int pos = urlWithParams.indexOf("?"); |
+ return (pos >= 0 ? urlWithParams.substring(0, pos) : urlWithParams); |
+ } |
} |