diff options
author | Selim Gurun <sgurun@google.com> | 2014-01-10 16:24:00 -0800 |
---|---|---|
committer | Selim Gurun <sgurun@google.com> | 2014-01-10 16:24:00 -0800 |
commit | 348cca6c61e1ad3f2d580298d9ec5f1826f64269 (patch) | |
tree | 380b06bae7e0ebc8232e996a228a78fa8831c136 /src/com/android/browser/IntentHandler.java | |
parent | 2b14bbb092998ab8e65b6e2dac13621e416d4351 (diff) | |
download | packages_apps_Browser-348cca6c61e1ad3f2d580298d9ec5f1826f64269.zip packages_apps_Browser-348cca6c61e1ad3f2d580298d9ec5f1826f64269.tar.gz packages_apps_Browser-348cca6c61e1ad3f2d580298d9ec5f1826f64269.tar.bz2 |
Do not let intents request viewing private browser files
Bug: 9793586
Change-Id: I8f6f03b05556ee4d6846c15752de9be54c003060
Diffstat (limited to 'src/com/android/browser/IntentHandler.java')
-rw-r--r-- | src/com/android/browser/IntentHandler.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java index 684cbba..772541d 100644 --- a/src/com/android/browser/IntentHandler.java +++ b/src/com/android/browser/IntentHandler.java @@ -107,6 +107,13 @@ public class IntentHandler { urlData = new UrlData(mSettings.getHomePage()); } + // If url is to view private data files, don't allow. + Uri uri = intent.getData(); + if (uri != null && uri.getScheme().startsWith("file") && + uri.getPath().startsWith(mActivity.getDatabasePath("foo").getParent())) { + return; + } + if (intent.getBooleanExtra(Browser.EXTRA_CREATE_NEW_TAB, false) || urlData.isPreloaded()) { Tab t = mController.openTab(urlData); |