After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616607 - Not all characters in HTML are correctly encoded.
Not all characters in HTML are correctly encoded.
Status: RESOLVED OBSOLETE
Product: GnuCash
Classification: Other
Component: Reports
2.3.x
Other Windows
: Normal normal
: ---
Assigned To: Andreas Köhler
Andreas Köhler
Depends on:
Blocks:
 
 
Reported: 2010-04-23 08:22 UTC by Tao Wang
Modified: 2018-06-29 22:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch fixes this issue (for non-eguile reports) (1.35 KB, patch)
2011-06-13 05:55 UTC, Tim M
none Details | Review
Patch version 2 (1.32 KB, patch)
2011-06-13 06:43 UTC, Tim M
rejected Details | Review

Description Tao Wang 2010-04-23 08:22:49 UTC
I have a transaction, which description is "J&J BABY WIPE TRAVEL PACK
20S". and in the html report, it is

<td>J&J BABY WIPE TRAVEL PACK 20S</td>

'&' should be encoded as '&amp;'

Could you double check the encode code against HTML standard to make sure every special characters are encoded?
Comment 1 Tim M 2011-06-13 05:55:40 UTC
Created attachment 189800 [details] [review]
This patch fixes this issue (for non-eguile reports)

This one was a PITA to track down and fix, but fixed it is.  See the attached patch.
Comment 2 Tim M 2011-06-13 06:00:21 UTC
...scratch that, it looks like it needs a little tweaking.  I should have a new patch shortly.
Comment 3 Tim M 2011-06-13 06:43:50 UTC
Created attachment 189802 [details] [review]
Patch version 2

Okay, here is a better patch.

The first patch would miss '&' if they occurred at the end of a line of body text, or in a few other corner cases.  The second version of the patch should convert all cases of "&", "<" and ">" in body text.


NOTE: This patch _ONLY_ fixes this defect in text within the body.  If the report title contains an '&' (such as the "Profit & Loss" report) then this defect will still occur within the "<title>SOME & TEXT</title>" text, but that is a far less straightforward fix due to issues with the multicolumn reports, so it must be addressed separately.

Thanks,
-Tim
Comment 4 Tim M 2011-06-13 06:54:28 UTC
FML.

!!!DO NOT USE ABOVE PATCHES!!!

Apparently the multicolumn report problems are not related to the <title> issue and occur with the posted patch version 2 as well.  The above patches will break multicolumn reports, so please do not apply them.  This issue apparently will require major overhauls to the reporting structure to fix due to severe multicolumn report conflicts with this patch.

I am not certain that this defect can be reasonably fixed within the existing reporting backend and may need to be deferred until the reporting backend is overhauled.

-Tim
Comment 5 Tim M 2011-06-13 06:56:24 UTC
Review of attachment 189802 [details] [review]:

See previous comment.  This patch breaks multicolumn reports because the entire individual reports including html tags appear to be embedded within the multicolumn report as an html body text object which causes all html entities within the individual reports to be escaped by this patch.
Comment 6 Carsten Rinke 2016-09-22 08:50:54 UTC
I tried to reproduce this behaviour but did not succeed - GnuCash 2.6.14
I did not try multicolumn reports.

To me it looks like the problem is gone.
Comment 7 John Ralls 2018-06-29 22:38:18 UTC
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=616607. Please continue processing the bug there and please update any external references or bookmarks.