OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 private class MatchesCallable implements Callable<Boolean> | 432 private class MatchesCallable implements Callable<Boolean> |
433 { | 433 { |
434 private String url; | 434 private String url; |
435 private String query; | 435 private String query; |
436 private String reqHost; | 436 private String reqHost; |
437 private String refHost; | 437 private String refHost; |
438 private String accept; | 438 private String accept; |
439 | 439 |
440 MatchesCallable(String url, String query, String reqHost, String refHost, St
ring accept) | 440 MatchesCallable(String url, String query, String reqHost, String refHost, St
ring accept) |
441 { | 441 { |
442 this.url = url; | 442 this.url = StringEscapeUtils.escapeJavaScript(url); |
443 this.query = query; | 443 this.query = StringEscapeUtils.escapeJavaScript(query); |
444 this.reqHost = reqHost != null ? reqHost : ""; | 444 this.reqHost = reqHost != null ? StringEscapeUtils.escapeJavaScript(reqHos
t) : ""; |
445 this.refHost = refHost != null ? refHost : ""; | 445 this.refHost = refHost != null ? StringEscapeUtils.escapeJavaScript(refHos
t) : ""; |
446 this.accept = accept != null ? accept : ""; | 446 this.accept = accept != null ? StringEscapeUtils.escapeJavaScript(accept)
: ""; |
447 } | 447 } |
448 | 448 |
449 @Override | 449 @Override |
450 public Boolean call() throws Exception | 450 public Boolean call() throws Exception |
451 { | 451 { |
452 Boolean result = (Boolean) js.evaluate("matchesAny('" + url + "', '" + que
ry + "', '" + reqHost + "', '" + refHost + "', '" + accept + "');"); | 452 Boolean result = (Boolean) js.evaluate("matchesAny('" + url + "', '" + que
ry + "', '" + reqHost + "', '" + refHost + "', '" + accept + "');"); |
453 return result; | 453 return result; |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 } | 1089 } |
1090 return result; | 1090 return result; |
1091 } | 1091 } |
1092 | 1092 |
1093 protected void onProgressUpdate(Integer... progress) | 1093 protected void onProgressUpdate(Integer... progress) |
1094 { | 1094 { |
1095 Log.d("HTTP", "Progress: " + progress[0].intValue()); | 1095 Log.d("HTTP", "Progress: " + progress[0].intValue()); |
1096 } | 1096 } |
1097 } | 1097 } |
1098 } | 1098 } |
OLD | NEW |