Skip to content

Commit 705665a

Browse files
Bart SearsAndroid (Google) Code Review
authored andcommitted
Merge "Do not allow file:// access when it is disabled. Do not merge." into ics-mr1
2 parents fb578b6 + b2c63ab commit 705665a

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)