Author: mhabersack
Date: 2007-05-28 06:15:30 -0400 (Mon, 28 May 2007)
New Revision: 78041

Modified:
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
Log:
2007-05-28  Marek Habersack  <[EMAIL PROTECTED]>

        * HttpRequest.cs: since Path is used from within
        WebConfigurationManager, under some conditions it may lead to
        endless recursion if the UrlComponents is not instantiated when
        Path_get is called.


Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-05-28 10:06:33 UTC 
(rev 78040)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-05-28 10:15:30 UTC 
(rev 78041)
@@ -1,3 +1,10 @@
+2007-05-28  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * HttpRequest.cs: since Path is used from within
+       WebConfigurationManager, under some conditions it may lead to
+       endless recursion if the UrlComponents is not instantiated when
+       Path_get is called.
+
 2007-05-21  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * HttpContext.cs: added ProfileInitialized boolean property

Modified: trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2007-05-28 
10:06:33 UTC (rev 78040)
+++ trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2007-05-28 
10:15:30 UTC (rev 78041)
@@ -882,12 +882,27 @@
 
                public string Path {
                        get {
-                               if (unescaped_path == null)
+                               if (unescaped_path == null) {
+                                       string path;
+                                       if (url_components != null) {
+                                               // use only if it's already 
been instantiated, so that we can't go into endless
+                                               // recursion in some scenarios
+                                               path = UrlComponents.Path;
+                                       } else {
 #if NET_2_0
-                                       unescaped_path = Uri.UnescapeDataString 
(UrlComponents.Path);
+                                               path = ApplyUrlMapping 
(worker_request.GetUriPath ());
 #else
-                                       unescaped_path = HttpUtility.UrlDecode 
(UrlComponents.Path);
+                                               path = 
worker_request.GetUriPath ();
 #endif
+                                       }
+                                               
+#if NET_2_0
+                                       unescaped_path = Uri.UnescapeDataString 
(path);
+#else
+                                       unescaped_path = HttpUtility.UrlDecode 
(path);
+#endif
+                               }
+                               
                                return unescaped_path;
                        }
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to