Permalink
Browse files

2005-04-25 Atsushi Enomoto <atsushi@ximian.com>

	* XmlTextReader.cs : Check empty BaseURI before being used to
	  resolve Uri. Patch by Heath Harrelson. Fixed bug #74704.


svn path=/branches/mono-1-0/mcs/; revision=43525
  • Loading branch information...
1 parent 5d2ccdb commit 1429f06a9e3baf56245ec2433dcdb77e76eba684 @atsushieno atsushieno committed Apr 25, 2005
Showing with 17 additions and 3 deletions.
  1. +5 −0 mcs/class/System.XML/System.Xml/ChangeLog
  2. +12 −3 mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -1,3 +1,8 @@
+2005-04-25 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlTextReader.cs : Check empty BaseURI before being used to
+ resolve Uri. Patch by Heath Harrelson. Fixed bug #74704.
+
2005-01-13 Atsushi Enomoto <atsushi@ximian.com>
* XmlResolver.cs : throw ArgumentException in ResolveUri().
@@ -40,7 +40,7 @@
using System;
using System.Collections;
-using System.Globalization;
+using System.Globalization;
using System.IO;
using System.Security.Policy;
using System.Text;
@@ -1332,8 +1332,17 @@ private void ReadStartTag ()
string baseUri = GetAttribute ("xml:base");
if (baseUri != null) {
- if (this.resolver != null)
- parserContext.BaseURI = resolver.ResolveUri (new Uri (BaseURI), baseUri).ToString ();
+ if (this.resolver != null) {
+ Uri buri =
+ BaseURI != String.Empty ?
+ new Uri (BaseURI) : null;
+ Uri uri = resolver.ResolveUri (
+ buri, baseUri);
+ parserContext.BaseURI =
+ uri != null ?
+ uri.ToString () :
+ String.Empty;
+ }
else
parserContext.BaseURI = baseUri;
}

0 comments on commit 1429f06

Please sign in to comment.