Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@ximian.com>2009-04-28 19:55:19 +0400
committerSebastien Pouliot <sebastien@ximian.com>2009-04-28 19:55:19 +0400
commitcc6d045346f29af685c90dc4e0226167803524f8 (patch)
tree7d8553c0234da1ba1fd7d70d3cffbf60f9876440 /mcs/class/System.XML/System.Xml
parent42f2df1f80db0a80631827b5bc153682d740a668 (diff)
In Test/System.Xml:
2009-04-28 Sebastien Pouliot <sebastien@ximian.com> * XmlReaderCommonTests.cs: Add test case for an empty string url In System.Xml: 2009-04-28 Sebastien Pouliot <sebastien@ximian.com> * XmlTextReader.cs (InitializeContext): Under NET_2_1 do not give a second change using Path.GetFullPath. (GetStreamFromUrl) Add extra validations that would be missed in NET_2_1 svn path=/trunk/mcs/; revision=132856
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog6
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs10
2 files changed, 16 insertions, 0 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 6b29611ba50..2c3c9c5bac5 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-28 Sebastien Pouliot <sebastien@ximian.com>
+
+ * XmlTextReader.cs (InitializeContext): Under NET_2_1 do not give
+ a second change using Path.GetFullPath. (GetStreamFromUrl) Add
+ extra validations that would be missed in NET_2_1
+
2009-04-28 Sebastien Pouliot <sebastien@ximian.com>
* XmlReaderSettings.cs: Add MaxCharactersInDocument property for
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
index e2d6211f520..1a1a13e002c 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -182,6 +182,12 @@ namespace System.Xml
private Stream GetStreamFromUrl (string url, out string absoluteUriString)
{
+#if NET_2_1
+ if (url == null)
+ throw new ArgumentNullException ("url");
+ if (url.Length == 0)
+ throw new ArgumentException ("url");
+#endif
Uri uri = resolver.ResolveUri (null, url);
absoluteUriString = uri != null ? uri.ToString () : String.Empty;
return resolver.GetEntity (uri, null, typeof (Stream)) as Stream;
@@ -1054,6 +1060,9 @@ namespace System.Xml
nsmgr = nsmgr != null ? nsmgr : new XmlNamespaceManager (nameTable);
if (url != null && url.Length > 0) {
+#if NET_2_1
+ Uri uri = new Uri (url, UriKind.RelativeOrAbsolute);
+#else
Uri uri = null;
try {
#if NET_2_0
@@ -1065,6 +1074,7 @@ namespace System.Xml
string path = Path.GetFullPath ("./a");
uri = new Uri (new Uri (path), url);
}
+#endif
parserContext.BaseURI = uri.ToString ();
}