GenoPro Home
|
Get Started With My Genealogy Tree
|
Buy
|
Login
|
Privacy
|
Search
|
Site Map
GenoPro Support Forum
Home
Search
Tags
Who's On
Welcome Guest
(
Login
|
Register
)
Recent Posts
Popular Topics
Home
»
GenoPro
»
Report Generator
»
Report Generator Bugs
»
Util.FormatPhrase() does not encode special HTML characters
Util.FormatPhrase() does not encode special HTML characters
Rate Topic
Topic View
Topic Options
Author
The GenoPro SDK states that WritePhrase() and Report.Write(Util.FormatPhrase()) are equivalent.
genome
Posted Wednesday, May 11, 2011
-
Post #28343
Legendary Master
Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1
Last Login: 2 days ago @ 9:23 PM
Posts: 3,464,
Visits: 26,854
Whilst investigating a reported issue in the
Narrative Report
I found what appears to be a bug in the
Report Generator
's Util.
FormatPhrase
method.
The
GenoPro SDK
states that WritePhrase() and Report.Write(Util.FormatPhrase()) are equivalent.
However it appears that the two methods differ in that Util.FormatPhrase appears not to encode special characters as per Util.HtmlEncode. I have attached files for a simple skin to demonstrate this.
<html><head><title>Tester</title></head><body>
<h1>Test to check Util.FormatPhrase versus Report.WritePhrase</h1>
<%[
Report.Write(Util.FormatPhrase("{0}", "This line was produced by Report.Write Util.FormatPhrase(...) and contains the following characters that should be html encoded > < & "));
Report.WriteLn(Report.TagBr);
Report.WritePhrase("{0}", "This line was produced by Report.WritePhrase(...) and contains the following characters that should be html encoded > < & ");
Report.WriteLn(Report.TagBr);
Report.WriteText("View page source in browser to check HTML encoding");
]%>
</body></html>
Run the skin against any .gno and examine the page source of the HTML produced. e.g.
<html><head><title>Tester</title></head><body>
<h1>Test to check Util.FormatPhrase versus Report.WritePhrase</h1>
This line was produced by Report.Write Util.FormatPhrase(...) and contains the following characters that should be html encoded > < & <br />
This line was produced by Report.WritePhrase(...) and contains the following characters that should be html encoded > < & <br />
View page source in browser to check HTML encoding
</body></html>
The characters '> < &' appear unencoded from FormatPhrase.
'lego audio video erro ergo disco'
 
or "
I read, I listen, I watch, I make mistakes, therefore I learn
"
tester.htm
(
119 views,
608 bytes
)
Config.xml
(
103 views,
340 bytes
)
Edited:
Thursday, May 12, 2011 by
GenoProSupport
Threaded View
Threaded View
Util.FormatPhrase() does not encode special HTML characters
By
genome
(
Wednesday, May 11, 2011
)
Wow. Thanks for reporting this bug. What would you prefer? Do you...
By
GenoProSupport
(
Wednesday, May 11, 2011
)
[quote][b]GenoProSupport (11-May-2011)[/b][hr]What would you prefer?...
By
genome
(
Wednesday, May 11, 2011
)
[quote]Util. Write Phrase ?? [/quote] My mistake, I meant...
By
GenoProSupport
(
Thursday, May 12, 2011
)
Yes, having examined the Narrative Report code further I agree that...
By
genome
(
Thursday, May 12, 2011
)
Similar Topics
Reading This Topic
Powered By InstantForum.NET 2010-3-x © 2025
Execution: 0.016.
4 queries.
Compression Enabled.
Search All Forums...
GO
Advanced Search
Rate Topic
Great
Good
Average
Bad
Poor
Rate This Topic
Flat Ascending
Flat Descending
Threaded
Subscribe To Topic
Print This Topic
Goto Topics Forum