Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 019C010789 for ; Fri, 1 Nov 2013 01:27:02 +0000 (UTC) Received: (qmail 99757 invoked by uid 500); 1 Nov 2013 01:26:58 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 99422 invoked by uid 500); 1 Nov 2013 01:26:57 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 98850 invoked by uid 99); 1 Nov 2013 01:26:57 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Nov 2013 01:26:57 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 426D0D027; Fri, 1 Nov 2013 01:26:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Fri, 01 Nov 2013 01:27:43 -0000 Message-Id: <58582affbf554da0a54a4dc74682f39a@git.apache.org> In-Reply-To: <6e50592f080745d9b8e6985cca410e08@git.apache.org> References: <6e50592f080745d9b8e6985cca410e08@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] [abbrv] merging 2.9.1->2.9.x http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/framework/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --cc wp7/framework/Properties/AssemblyInfo.cs index 122ead8,70ee17d..29be4ee --- a/wp7/framework/Properties/AssemblyInfo.cs +++ b/wp7/framework/Properties/AssemblyInfo.cs @@@ -2,11 -2,11 +2,11 @@@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; --// General Information about an assembly is controlled through the following ++// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WPCordovaClassLib")] - [assembly: AssemblyDescription("0.0.0")] -[assembly: AssemblyDescription("2.9.0")] ++[assembly: AssemblyDescription("2.9.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Apache Cordova")] [assembly: AssemblyProduct("WPCordovaClassLib")] @@@ -14,8 -14,8 +14,8 @@@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] --// Setting ComVisible to false makes the types in this assembly not visible --// to COM components. If you need to access a type in this assembly from ++// Setting ComVisible to false makes the types in this assembly not visible ++// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@@ -25,13 -25,13 +25,13 @@@ // Version information for an assembly consists of the following four values: // // Major Version --// Minor Version ++// Minor Version // Build Number // Revision // --// You can specify all the values or you can default the Revision and Build Numbers ++// You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: - [assembly: AssemblyVersion("0.0.0.0")] - [assembly: AssemblyFileVersion("0.0.0.0")] -[assembly: AssemblyVersion("2.9.0.0")] -[assembly: AssemblyFileVersion("2.9.0")] ++[assembly: AssemblyVersion("2.9.1.0")] ++[assembly: AssemblyFileVersion("2.9.1")] http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/template/config.xml ---------------------------------------------------------------------- diff --cc wp7/template/config.xml index fd3a63f,d1ef04b..a5f7010 --- a/wp7/template/config.xml +++ b/wp7/template/config.xml @@@ -20,53 -20,68 +20,52 @@@ # --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/template/cordovalib/ConfigHandler.cs ---------------------------------------------------------------------- diff --cc wp7/template/cordovalib/ConfigHandler.cs index 05829b5,fe646c7..cfdd007 --- a/wp7/template/cordovalib/ConfigHandler.cs +++ b/wp7/template/cordovalib/ConfigHandler.cs @@@ -83,7 -83,7 +83,7 @@@ namespace WPCordovaClassLib.CordovaLi Uri uri = new Uri(origin.Replace("*", "replaced-text"), UriKind.Absolute); string tempHostName = uri.Host.Replace("replaced-text", "*"); -- //if (uri.HostNameType == UriHostNameType.Dns){} ++ //if (uri.HostNameType == UriHostNameType.Dns){} // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova' will match 'org.apache.cordova') if (tempHostName.StartsWith("*.")) { //"(\\s{0}|*.)" @@@ -107,15 -107,15 +107,15 @@@ } -- /** -- ++ /** ++ An access request is granted for a given URI if there exists an item inside the access-request list such that: - The URI's scheme component is the same as scheme; and - if subdomains is false or if the URI's host component is not a domain name (as defined in [RFC1034]), the URI's host component is the same as host; or - if subdomains is true, the URI's host component is either the same as host, or is a subdomain of host (as defined in [RFC1034]); and - the URI's port component is the same as port. -- ++ **/ public bool URLIsAllowed(string url) @@@ -181,10 -169,37 +181,33 @@@ private void LoadPluginFeatures(XDocument document) { -<<<<<<< HEAD + var plugins = from results in document.Descendants("plugin") + select new + { + name = (string)results.Attribute("name"), + autoLoad = results.Attribute("onload") + }; + + foreach (var plugin in plugins) + { + Debug.WriteLine("Warning: Deprecated use of by plugin : " + plugin.name); + PluginConfig pConfig = new PluginConfig(plugin.name, plugin.autoLoad != null && plugin.autoLoad.Value == "true"); + if (pConfig.Name == "*") + { + AllowAllPlugins = true; + // break; wait, don't, some still could be autoload + } + else + { + AllowedPlugins[pConfig.Name] = pConfig; + } + } + var features = from f in document.Descendants() where f.Name.LocalName == "feature" select f; ->>>>>>> 7944b67... [CB-4807] Handle config.xml namespaces + foreach (var feature in features) { var name = feature.Attribute("name"); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp8/template/config.xml ---------------------------------------------------------------------- diff --cc wp8/template/config.xml index fd3a63f,d1ef04b..6377b34 --- a/wp8/template/config.xml +++ b/wp8/template/config.xml @@@ -20,53 -20,68 +20,54 @@@ # --> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp8/template/cordovalib/ConfigHandler.cs ---------------------------------------------------------------------- diff --cc wp8/template/cordovalib/ConfigHandler.cs index fcb8665,f88510f..cfdd007 --- a/wp8/template/cordovalib/ConfigHandler.cs +++ b/wp8/template/cordovalib/ConfigHandler.cs @@@ -45,12 -45,12 +45,22 @@@ namespace WPCordovaClassLib.CordovaLi return Preferences[key]; } -- protected static string[] AllowedSchemes = { "http", "https", "ftp", "ftps" }; ++ protected static string[] AllowedSchemes = {"http","https","ftp","ftps"}; protected bool SchemeIsAllowed(string scheme) { return AllowedSchemes.Contains(scheme); } ++ protected string PathAndQuery(Uri uri) ++ { ++ string result = uri.LocalPath; ++ if (uri.Query.Length > 0) ++ { ++ result += uri.Query; ++ } ++ return result; ++ } ++ protected void AddWhiteListEntry(string origin, bool allowSubdomains) { @@@ -73,7 -73,7 +83,7 @@@ Uri uri = new Uri(origin.Replace("*", "replaced-text"), UriKind.Absolute); string tempHostName = uri.Host.Replace("replaced-text", "*"); -- //if (uri.HostNameType == UriHostNameType.Dns){} ++ //if (uri.HostNameType == UriHostNameType.Dns){} // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova' will match 'org.apache.cordova') if (tempHostName.StartsWith("*.")) { //"(\\s{0}|*.)" @@@ -83,9 -83,9 +93,10 @@@ { hostName = tempHostName.Replace(".", @"\.").Replace("*", @"\w*"); } ++ // "^https?://" -- hostMatchingRegex = uri.Scheme + "://" + hostName + uri.PathAndQuery; - Debug.WriteLine("Adding regex :: " + hostMatchingRegex); ++ hostMatchingRegex = uri.Scheme + "://" + hostName + PathAndQuery(uri); + //Debug.WriteLine("Adding regex :: " + hostMatchingRegex); AllowedDomains.Add(hostMatchingRegex); } @@@ -96,35 -96,35 +107,35 @@@ } -- /** -- ++ /** ++ An access request is granted for a given URI if there exists an item inside the access-request list such that: - The URI's scheme component is the same as scheme; and - if subdomains is false or if the URI's host component is not a domain name (as defined in [RFC1034]), the URI's host component is the same as host; or - if subdomains is true, the URI's host component is either the same as host, or is a subdomain of host (as defined in [RFC1034]); and - the URI's port component is the same as port. -- ++ **/ public bool URLIsAllowed(string url) { // easy case first -- if (this.AllowAllDomains) ++ if (AllowAllDomains ) { return true; } else { // start simple -- Uri uri = new Uri(url, UriKind.RelativeOrAbsolute); ++ Uri uri = new Uri(url,UriKind.RelativeOrAbsolute); if (uri.IsAbsoluteUri) { if (this.SchemeIsAllowed(uri.Scheme)) { // additional test because our pattern will always have a trailing '/' string matchUrl = url; -- if (uri.PathAndQuery == "/") ++ if (PathAndQuery(uri) == "/") { matchUrl = url + "/"; } @@@ -134,8 -134,8 +145,8 @@@ { // make sure it is at the start, and not part of the query string // special case :: http://some.other.domain/page.html?x=1&g=http://build.apache.org/ -- if (Regex.IsMatch(uri.Scheme + "://" + uri.Host + "/", pattern) || -- (!Regex.IsMatch(uri.PathAndQuery, pattern))) ++ if ( Regex.IsMatch(uri.Scheme + "://" + uri.Host + "/", pattern) || ++ (!Regex.IsMatch(PathAndQuery(uri), pattern))) { return true; } @@@ -151,11 -151,11 +162,6 @@@ return false; } -- public bool IsPluginAllowed(string key) -- { -- return AllowAllPlugins || AllowedPlugins.Keys.Contains(key); -- } -- public string[] AutoloadPlugins { get @@@ -168,11 -168,35 +174,39 @@@ } } - private void LoadPluginFeatures(XDocument document) ++ public bool IsPluginAllowed(string key) + { ++ return AllowAllPlugins || AllowedPlugins.Keys.Contains(key); ++ } + - var plugins = from results in document.Descendants() - where results.Name.LocalName == "plugin" - select results; - + private void LoadPluginFeatures(XDocument document) + { - var features = from feats in document.Descendants() - where feats.Name.LocalName == "feature" - select feats; ++ var plugins = from results in document.Descendants("plugin") ++ select new ++ { ++ name = (string)results.Attribute("name"), ++ autoLoad = results.Attribute("onload") ++ }; + + foreach (var plugin in plugins) + { - string name = (string)plugin.Attribute("name"); - var onload = plugin.Attribute("onload"); - - Debug.WriteLine("Warning: Deprecated use of by plugin : " + name); - PluginConfig pConfig = new PluginConfig(name, onload != null && onload.Value == "true"); ++ Debug.WriteLine("Warning: Deprecated use of by plugin : " + plugin.name); ++ PluginConfig pConfig = new PluginConfig(plugin.name, plugin.autoLoad != null && plugin.autoLoad.Value == "true"); + if (pConfig.Name == "*") + { + AllowAllPlugins = true; + // break; wait, don't, some still could be autoload + } + else + { + AllowedPlugins[pConfig.Name] = pConfig; + } + } + - var features = from feats in document.Descendants() - where feats.Name.LocalName == "feature" - select feats; ++ var features = from f in document.Descendants() ++ where f.Name.LocalName == "feature" ++ select f; ++ foreach (var feature in features) { @@@ -182,12 -206,12 +216,12 @@@ select results; var value = values.FirstOrDefault(); -- if(value != null) ++ if (value != null) { string key = (string)value.Attribute("value"); Debug.WriteLine("Adding feature.value=" + key); var onload = value.Attribute("onload"); -- PluginConfig pConfig = new PluginConfig(key,onload != null && onload.Value == "true"); ++ PluginConfig pConfig = new PluginConfig(key, onload != null && onload.Value == "true"); AllowedPlugins[key] = pConfig; } } @@@ -233,8 -257,8 +267,8 @@@ } var contentsTag = (from results in document.Descendants() -- where results.Name.LocalName == "content" -- select results).FirstOrDefault(); ++ where results.Name.LocalName == "content" ++ select results).FirstOrDefault(); if (contentsTag != null) {