CB-1564: DroidGap.loadUrl follows a path that never checks the white list

Whoops, I needed to do more testing. This looks like the trick but it could use 
a review.


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

Branch: refs/heads/master
Commit: bfd1bfe9f051c95228c157170e3b38937dac388c
Parents: 17a4b51
Author: Simon MacDonald <simon.macdon...@gmail.com>
Authored: Mon Oct 1 16:03:28 2012 -0400
Committer: Simon MacDonald <simon.macdon...@gmail.com>
Committed: Tue Oct 2 09:52:30 2012 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java     |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/bfd1bfe9/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java 
b/framework/src/org/apache/cordova/CordovaWebView.java
index 106f60d..6488ead 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -481,7 +481,9 @@ public class CordovaWebView extends WebView {
         if (LOG.isLoggable(LOG.DEBUG) && !url.startsWith("javascript:")) {
             LOG.d(TAG, ">>> loadUrlNow()");
         }
-        super.loadUrl(url);
+        if (url.startsWith("file://") || url.indexOf(this.baseUrl) == 0 || 
url.startsWith("javascript:") || this.isUrlWhiteListed(url)) {
+            super.loadUrl(url);            
+        }
     }
 
     /**

Reply via email to