From: Marek Habersack Date: Sat, 15 Aug 2009 00:32:46 +0000 (-0000) Subject: 2009-08-15 Marek Habersack X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=7dadfa1b28ae441f7dd6617f772a09682c2912d9;p=mono.git 2009-08-15 Marek Habersack * AspGenerator.cs: CodeRenderParser.DoParseExpressions - match newline characters inside expressions. Fixes bug #526449 2009-08-15 Marek Habersack * Makefile (TEST_RESOURCE_FILES): added Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx svn path=/trunk/mcs/; revision=139989 --- diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog index 54287ab63b2..3254af03e24 100644 --- a/mcs/class/System.Web/ChangeLog +++ b/mcs/class/System.Web/ChangeLog @@ -1,3 +1,8 @@ +2009-08-15 Marek Habersack + + * Makefile (TEST_RESOURCE_FILES): added + Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx + 2009-07-30 Raja R Harinath * Makefile ($(build_lib)): Move cyclic dependencies onto this. diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile index 10e2d8adff1..1cc9d70493f 100644 --- a/mcs/class/System.Web/Makefile +++ b/mcs/class/System.Web/Makefile @@ -174,7 +174,8 @@ TEST_RESOURCE_FILES = \ Test/mainsoft/NunitWebResources/PreprocessorDirectivesInMarkup.aspx \ Test/mainsoft/NunitWebResources/UnquotedAngleBrackets.aspx \ Test/mainsoft/NunitWebResources/FullTagsInText.aspx \ - Test/mainsoft/NunitWebResources/TagsExpressionsAndCommentsInText.aspx + Test/mainsoft/NunitWebResources/TagsExpressionsAndCommentsInText.aspx \ + Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx RESX_DIST = resources/TranslationResources.resx ifneq (1, $(FRAMEWORK_VERSION_MAJOR)) diff --git a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs index 9a566676810..8e5555bdffa 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs @@ -1518,7 +1518,7 @@ namespace System.Web.Compilation void DoParseExpressions (string str) { int startIndex = 0, index = 0; - Regex codeDirective = new Regex ("(<%(?!@)(?.*?)%>)|(<[\\w:\\.]+.*?runat=[\"']?server[\"']?.*?/>)", + Regex codeDirective = new Regex ("(<%(?!@)(?(.|\\s)*?)%>)|(<[\\w:\\.]+.*?runat=[\"']?server[\"']?.*?/>)", RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.CultureInvariant); Match match; int strLen = str.Length; diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog index 94c99e570d1..662bf98f47e 100644 --- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog +++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog @@ -1,3 +1,8 @@ +2009-08-15 Marek Habersack + + * AspGenerator.cs: CodeRenderParser.DoParseExpressions - match + newline characters inside expressions. Fixes bug #526449 + 2009-08-14 Marek Habersack * BuildManagerDirectoryBuilder.cs: when VirtualPathProvider diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs index 961dc780062..0c93fab2837 100644 --- a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs @@ -58,6 +58,7 @@ namespace MonoTests.System.Web.Compilation { WebTest.CopyResource (GetType (), "UnquotedAngleBrackets.aspx", "UnquotedAngleBrackets.aspx"); WebTest.CopyResource (GetType (), "FullTagsInText.aspx", "FullTagsInText.aspx"); WebTest.CopyResource (GetType (), "TagsExpressionsAndCommentsInText.aspx", "TagsExpressionsAndCommentsInText.aspx"); + WebTest.CopyResource (GetType (), "NewlineInCodeExpression.aspx", "NewlineInCodeExpression.aspx"); #if NET_2_0 WebTest.CopyResource (GetType (), "InvalidPropertyBind1.aspx", "InvalidPropertyBind1.aspx"); WebTest.CopyResource (GetType (), "InvalidPropertyBind2.aspx", "InvalidPropertyBind2.aspx"); @@ -203,8 +204,17 @@ namespace MonoTests.System.Web.Compilation { // Just test if it doesn't throw an exception new WebTest ("PreprocessorDirectivesInMarkup.aspx").Run (); } -#endif + [Test (Description="Bug #526449")] + public void NewlineInCodeExpression () + { + string pageHtml = new WebTest ("NewlineInCodeExpression.aspx").Run (); + string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); + string originalHtml = "bla"; + HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1"); + } +#endif + [Test (Description="Bug #517656")] public void ServerControlInClientSideComment () { diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx new file mode 100644 index 00000000000..12c8965a5e3 --- /dev/null +++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx @@ -0,0 +1,17 @@ +<%@ Page Language="C#" AutoEventWireup="true" %> + + + + + + + + +
+
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %>">bla<%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %> +
+
+ +