incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject [9/48] js commit: fix for invalid uri with leading /
Date Thu, 07 Jun 2012 20:40:43 GMT
fix for invalid uri with leading /


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

Branch: refs/heads/master
Commit: 75096bb5859b08988f80d2c280a4d1055c402d0d
Parents: 3ae429b
Author: Tim Kim <tim.kim@nitobi.com>
Authored: Fri Jun 1 12:31:12 2012 -0700
Committer: Tim Kim <tim.kim@nitobi.com>
Committed: Thu Jun 7 13:40:24 2012 -0700

----------------------------------------------------------------------
 .../plugin/playbook/resolveLocalFileSystemURI.js   |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/75096bb5/lib/playbook/plugin/playbook/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/lib/playbook/plugin/playbook/resolveLocalFileSystemURI.js b/lib/playbook/plugin/playbook/resolveLocalFileSystemURI.js
index c042a7e..259b398 100644
--- a/lib/playbook/plugin/playbook/resolveLocalFileSystemURI.js
+++ b/lib/playbook/plugin/playbook/resolveLocalFileSystemURI.js
@@ -41,6 +41,12 @@ module.exports = function(uri, successCallback, errorCallback) {
         uri = uri.split('?')[0];
     }
 
+    // check for leading /
+    if(uri.indexOf('/')==0){
+        fail(FileError.ENCODING_ERR);
+        return;
+    }
+
     // Entry object is borked - unable to instantiate a new Entry object so just create one
     var theEntry = {};
     if(blackberry.io.dir.exists(uri)){


Mime
View raw message