[Mono-bugs] [Bug 61429][Nor] New - AspParser - Case Sensitivity of Server-Side Include Directive

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 12 Jul 2004 08:20:12 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ivan@chimerical.com.au.

http://bugzilla.ximian.com/show_bug.cgi?id=61429

--- shadow/61429	2004-07-12 08:20:12.000000000 -0400
+++ shadow/61429.tmp.23161	2004-07-12 08:20:12.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 61429
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ivan@chimerical.com.au               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: AspParser - Case Sensitivity of Server-Side Include Directive
+
+Description of Problem:
+AspParser is case sensitive to the Server-Side Include Directive.
+I stubbornly believe it shouldn't be.
+
+
+Steps to reproduce the problem:
+1. Create an ASPX page using <!-- #Include virtual=".\include\header.inc" -
+->
+2. Watch it not work.
+3. Change it to <!-- #include virtual=".\include\header.inc" -->
+
+
+Actual Results:
+Tag is passed through unchanged.
+
+Expected Results:
+The contents of the include file should be included
+
+How often does this happen? 
+Always
+
+Proposed patch:
+Index: class/System.Web/System.Web.Compilation/AspParser.cs
+===================================================================
+RCS file: /mono/mcs/class/System.Web/System.Web.Compilation/AspParser.cs,v
+retrieving revision 1.17
+diff -u -r1.17 AspParser.cs
+--- class/System.Web/System.Web.Compilation/AspParser.cs        24 Jun 
+2004 20:58:16 -0000      1.17
++++ class/System.Web/System.Web.Compilation/AspParser.cs        9 Jul 2004 
+08:08:18 -0000
+@@ -184,7 +184,7 @@
+                        str = str.Substring (2).Trim ();
+                        int len = str.Length;
+                        int lastQuote = str.LastIndexOf ('"');
+-                       if (len < 10 || lastQuote != len - 1 || !
+str.StartsWith("#include "))
++                       if (len < 10 || lastQuote != len - 1 || !
+str.ToLower().StartsWith("#include "))
+                                return false;
+
+                        str = str.Substring (9).Trim ();