This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed spurious 'new' in doc. Need to call htmlentities() twice to e…
…nsure proper rendering of HTML content.
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e2098e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the call to htmlentities doubled? This creates unreadable HTML output when comparing HTML or PHP files with lots of > and <...
e2098e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember, I would have to look again in all this to figure why.
The diff'ed HTML does display properly on this page: http://www.raymondhill.net/finediff/viewdiff.php?data=c923f8bf66c6c66df22ef63d43faefc4da98757c. So clearly it is required.
However not on http://www.raymondhill.net/finediff/viewdiff-ex.php
, because this one also call htmlentities() on the result -- which means 3 levels of htmlentities encoding. I believe this was done one extra time there because it is also possible to test the standard diff library, which doesn't escape HTML entities.Trying to figure why it doesn't display properly in viewdiff-ex.php.e2098e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, never mind my above mumbling. I don't know why I ended up encoding twice, this doesn't make much sense. It displays properly in viewdiff.php simply because I decode once using
mb_convert_encoding
before outputting the result. If a caller wants to encode twice, it is its business, but the library shouldn't be doing this. It appears I got lost somewhere in the maze of encoding/decoding.I will remove the silly double encoding.
e2098e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I know (from personal experience) exactly how things like that happen...