cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [1/3] android commit: CB-7291: Only add file, content and data URLs to internal whitelist
Date Tue, 26 Aug 2014 19:25:01 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/CB-7291 8b55a1698 -> 6e222c393


CB-7291: Only add file, content and data URLs to internal whitelist


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/3b3bd9b6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/3b3bd9b6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/3b3bd9b6

Branch: refs/heads/CB-7291
Commit: 3b3bd9b6c917fe3ca9fdc967e9812b56ce7ca47a
Parents: 4e3331b
Author: Ian Clelland <iclelland@chromium.org>
Authored: Thu Aug 21 16:10:32 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Thu Aug 21 16:27:48 2014 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/ConfigXmlParser.java | 5 +++++
 framework/src/org/apache/cordova/Whitelist.java       | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3b3bd9b6/framework/src/org/apache/cordova/ConfigXmlParser.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/ConfigXmlParser.java b/framework/src/org/apache/cordova/ConfigXmlParser.java
index 9179f98..2a667a9 100644
--- a/framework/src/org/apache/cordova/ConfigXmlParser.java
+++ b/framework/src/org/apache/cordova/ConfigXmlParser.java
@@ -82,6 +82,11 @@ public class ConfigXmlParser {
         boolean insideFeature = false;
         ArrayList<String> urlMap = null;
 
+        // Add implicitly allowed URLs
+        internalWhitelist.addWhiteListEntry("file:///*", false);
+        internalWhitelist.addWhiteListEntry("content:///*", false);
+        internalWhitelist.addWhiteListEntry("data:*", false);
+
         while (eventType != XmlResourceParser.END_DOCUMENT) {
             if (eventType == XmlResourceParser.START_TAG) {
                 String strNode = xml.getName();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3b3bd9b6/framework/src/org/apache/cordova/Whitelist.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Whitelist.java b/framework/src/org/apache/cordova/Whitelist.java
index 5101ec3..d0f823c 100644
--- a/framework/src/org/apache/cordova/Whitelist.java
+++ b/framework/src/org/apache/cordova/Whitelist.java
@@ -98,10 +98,6 @@ public class Whitelist {
 
     public Whitelist() {
         this.whiteList = new ArrayList<URLPattern>();
-        // Add implicitly allowed URLs
-        addWhiteListEntry("file:///*", false);
-        addWhiteListEntry("content:///*", false);
-        addWhiteListEntry("data:*", false);
     }
 
     /* Match patterns (from http://developer.chrome.com/extensions/match_patterns.html)


Mime
View raw message