cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] git commit: Add a check to config_parser that root tag is <widget>.
Date Mon, 23 Dec 2013 19:23:19 GMT
Add a check to config_parser that root tag is <widget>.


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

Branch: refs/heads/master
Commit: 837e8e367ae4feed4854f9ac95a8e906c893d818
Parents: 9b7fedf
Author: Mark Koudritsky <kamrik@chromium.org>
Authored: Mon Dec 23 14:22:27 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Dec 23 14:22:27 2013 -0500

----------------------------------------------------------------------
 src/config_parser.js | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/837e8e36/src/config_parser.js
----------------------------------------------------------------------
diff --git a/src/config_parser.js b/src/config_parser.js
index b6293d8..4267d30 100644
--- a/src/config_parser.js
+++ b/src/config_parser.js
@@ -27,6 +27,11 @@ function config_parser(path) {
     } catch (e) {
         throw new Error("Parsing "+path+" failed:\n"+e.message);
     }
+    var r = this.doc.getroot();
+    var xmlns ='http://www.w3.org/ns/widgets';
+    if((r.tag !== 'widget') || !r.attrib || (r.attrib.xmlns !== xmlns)) {
+        throw new Error("This file does not seem to be a cordova config.xml file: " + path);
+    }
     this.access = new access(this);
     this.preference = new preference(this);
 }


Mime
View raw message