Author: atsushi
Date: 2007-12-06 01:32:05 -0500 (Thu, 06 Dec 2007)
New Revision: 90794
Modified:
trunk/mcs/class/System.XML/System.Xml/ChangeLog
trunk/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
Log:
2007-12-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlUrlResolver.cs : in net_2_0, use Uri.IsAbsoluteUri to filter
relative URIs out.
* XmlUrlResolverTests.cs : fixed test; file://file.txt is to access
such a server whose (domain) name is "file.txt", which is actually
an absolute URI. Remove "regression" in the nunit test.
Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog 2007-12-06 04:33:17 UTC
(rev 90793)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog 2007-12-06 06:32:05 UTC
(rev 90794)
@@ -1,3 +1,8 @@
+2007-12-06 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XmlUrlResolver.cs : in net_2_0, use Uri.IsAbsoluteUri to filter
+ relative URIs out.
+
2007-11-09 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlConvert.cs : ToDateTime(XmlDateTimeSerializationMode) should
Modified: trunk/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs 2007-12-06
04:33:17 UTC (rev 90793)
+++ trunk/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs 2007-12-06
06:32:05 UTC (rev 90794)
@@ -65,6 +65,11 @@
if (ofObjectToReturn != typeof (Stream))
throw new XmlException ("This object type is
not supported.");
+#if NET_2_0
+ if (!absoluteUri.IsAbsoluteUri)
+ throw new ArgumentException ("uri must be
absolute.", "absoluteUri");
+#endif
+
if (absoluteUri.Scheme == "file") {
if (absoluteUri.AbsolutePath == String.Empty)
throw new ArgumentException ("uri must
be absolute.", "absoluteUri");
Modified: trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2007-12-06
04:33:17 UTC (rev 90793)
+++ trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2007-12-06
06:32:05 UTC (rev 90794)
@@ -1,3 +1,9 @@
+2007-12-06 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XmlUrlResolverTests.cs : fixed test; file://file.txt is to access
+ such a server whose (domain) name is "file.txt", which is actually
+ an absolute URI. Remove "regression" in the nunit test.
+
2007-11-12 Atsushi Enomoto <[EMAIL PROTECTED]>
* XsdValidatingReaderTests.cs : added test for #339934.
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
2007-12-06 04:33:17 UTC (rev 90793)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
2007-12-06 06:32:05 UTC (rev 90794)
@@ -73,12 +73,14 @@
resolver.GetEntity (uri, null, null);
}
+#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
public void GetEntityWithRelativeFileUri ()
{
- resolver.GetEntity (new Uri ("file://file.txt"), null,
typeof (Stream));
+ resolver.GetEntity (new Uri ("file.txt",
UriKind.Relative), null, typeof (Stream));
}
+#endif
[Test]
[ExpectedException (typeof (XmlException))]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches