Skip to content

Commit b2c63ab

Browse files
author
Ben Murdoch
committed
Do not allow file:// access when it is disabled. Do not merge.
Cherry pick of If2793f31cb37e0d3af15cb18e818bfa4058167fd If WebSettings is configured to disallow access to file:// URLs, then block them. Bug: 5773763 Change-Id: I0ab84cde90c955d31077329fddebc25978287c64
1 parent 30ad699 commit b2c63ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/java/android/webkit/BrowserFrame.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,13 @@ private WebResourceResponse shouldInterceptRequest(String url) {
941941
if (androidResource != null) {
942942
return new WebResourceResponse(null, null, androidResource);
943943
}
944+
945+
// Note that we check this after looking for an android_asset or
946+
// android_res URL, as we allow those even if file access is disabled.
947+
if (!mSettings.getAllowFileAccess() && url.startsWith("file://")) {
948+
return new WebResourceResponse(null, null, null);
949+
}
950+
944951
WebResourceResponse response = mCallbackProxy.shouldInterceptRequest(url);
945952
if (response == null && "browser:incognito".equals(url)) {
946953
try {

0 commit comments

Comments
 (0)