markstos/CGI.pm — pull request #12 by cebjyre (2012-03-13 01:08:14+00:00)
Title: Rt 75595

Two separate fixes to the unescapeHTML function, with separate commits for the tests and fixes.

1. Made the regex to find entities less greedy (won't accept internal ampersands) so '\&something\&' is no longer viewed as a full match
2. If the regex does match, but the substitution doesn't find a matching entity, keep the ampersand and semicolon so 'this\&that;' doesn't become 'thisthat'. Note: This fix wouldn't be appropriate for the above problem because the entity at the end of the string wouldn't be unescaped.