You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/02/08 00:40:26 UTC

[2/3] git commit: Unrevert "Add a check to config_parser that root tag is ."

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 <st...@gmail.com>
Authored: Fri Feb 7 15:38:55 2014 -0800
Committer: Steven Gill <st...@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);
 }