cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [12/16] android commit: Fix data URI decoding in CordovaResourceApi
Date Tue, 22 Oct 2013 19:20:10 GMT
Fix data URI decoding in CordovaResourceApi

It was not URI-decoding first, and so was broken for non-base64-encoded
URIs.
(cherry picked from commit 4e1aa8aa59d0a3d9c0deb1f57c9136a76535691e)


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

Branch: refs/heads/2.9.x
Commit: bcccb0c62058eb8bcbb0a54f156979945631807f
Parents: e1de55c
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Aug 13 14:08:30 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Oct 22 15:14:36 2013 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaResourceApi.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/bcccb0c6/framework/src/org/apache/cordova/CordovaResourceApi.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaResourceApi.java b/framework/src/org/apache/cordova/CordovaResourceApi.java
index cb85744..f03f1b5 100644
--- a/framework/src/org/apache/cordova/CordovaResourceApi.java
+++ b/framework/src/org/apache/cordova/CordovaResourceApi.java
@@ -315,7 +315,7 @@ public class CordovaResourceApi {
     }
     
     private OpenForReadResult readDataUri(Uri uri) {
-        String uriAsString = uri.toString().substring(5);
+        String uriAsString = uri.getSchemeSpecificPart();
         int commaPos = uriAsString.indexOf(',');
         if (commaPos == -1) {
             return null;


Mime
View raw message