incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] js commit: added sanity check for invalid urls, this should be extended to include every case identifiable without calling native.
Date Thu, 24 May 2012 21:44:03 GMT
Updated Branches:
  refs/heads/master 68eebbca4 -> 95f199e1c


added sanity check for invalid urls, this should be extended to include every case identifiable
without calling native.


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/95f199e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/95f199e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/95f199e1

Branch: refs/heads/master
Commit: 95f199e1c207dc89b84e79a9a7b27d6a3cc8fe14
Parents: 88ab6e6
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Thu May 24 14:42:28 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Thu May 24 14:42:28 2012 -0700

----------------------------------------------------------------------
 lib/common/plugin/resolveLocalFileSystemURI.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/95f199e1/lib/common/plugin/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/resolveLocalFileSystemURI.js b/lib/common/plugin/resolveLocalFileSystemURI.js
index adb48f1..68981df 100644
--- a/lib/common/plugin/resolveLocalFileSystemURI.js
+++ b/lib/common/plugin/resolveLocalFileSystemURI.js
@@ -16,10 +16,16 @@ module.exports = function(uri, successCallback, errorCallback) {
             errorCallback(new FileError(error));
         }
     };
+    // sanity check for 'not:valid:filename'
+    if(!uri || uri.split(":").length > 2) {
+        setTimeout( function() {
+            fail(FileError.ENCODING_ERR);
+        },0);
+        return;
+    }
     // if successful, return either a file or directory entry
     var success = function(entry) {
         var result;
-
         if (entry) {
             if (typeof successCallback === 'function') {
                 // create appropriate Entry object


Mime
View raw message