]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix and improve html_quote() (#1513)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Sun, 26 Nov 2023 10:37:40 +0000 (10:37 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 26 Nov 2023 10:37:45 +0000 (10:37 +0000)
commit703535b8a0a0152b712cf67061b8835e40ab152f
tree8fc962824f57b99a384fa75c263d5b81e71cc73f
parenta226c967b51fba5c3af4b8df5f21c55f9fa19f2a
Fix and improve html_quote() (#1513)

Fixed an html_quote() bug: Unwanted space characters in decimal numeric
character references (e.g., `&#  7;` for ASCII BEL character).

Encode single quote character (`'`) as `&apos;` rather than `&#39;`.

Reduced encoding complexity from O(5*n) to O(n), where n is input string
length (and 5 is the number of supported character references)!

Added unit tests.
src/Makefile.am
src/html/Quoting.cc
src/html/Quoting.h
src/tests/testHtmlQuote.cc [new file with mode: 0644]