cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/3] git commit: Unrevert "Add a check to config_parser that root tag is <widget>."
Date Fri, 07 Feb 2014 23:40:26 GMT
Unrevert "Add a check to config_parser that root tag is <widget>."

This reverts commit 134aa64055965a5119aafc87d74ce4031dc0b80a.


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

Branch: refs/heads/master
Commit: 8727029b58f4330d1a805f1cdbffcb86e4769264
Parents: b888175
Author: Steven Gill <stevengill97@gmail.com>
Authored: Fri Feb 7 15:38:55 2014 -0800
Committer: Steven Gill <stevengill97@gmail.com>
Committed: Fri Feb 7 15:38:55 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/8727029b/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