Skip to content

Commit

Permalink
Use filename-based whitelist instead of pattern whitelist to avoid cr…
Browse files Browse the repository at this point in the history
…ashing when the resource contains weird characters used in regexps
  • Loading branch information
RobbWatershed committed Jan 8, 2022
1 parent 9bdd758 commit 9b41824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/me/devsaki/hentoid/util/AdBlocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public boolean isBlocked(@NonNull final String url) {
Timber.e(iae);
return true; // Avoid feeding malformed URLs to Chromium on older Androids (crash reported on Lollipop)
}
addJsUrlPatternWhitelist("^" + cleanUrl.replace(".", "\\.") + "$");
addJsUrlWhitelist(cleanUrl);
Timber.d(">> grey file %s ALLOWED", url);
}

Expand Down

0 comments on commit 9b41824

Please sign in to comment.