Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1800934

Browse files
committed
#9061: warn that single quotes are never escaped.
1 parent 75f2f82 commit 1800934

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Doc/library/cgi.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,13 @@ algorithms implemented in this module in other circumstances.
324324
Convert the characters ``'&'``, ``'<'`` and ``'>'`` in string *s* to HTML-safe
325325
sequences. Use this if you need to display text that might contain such
326326
characters in HTML. If the optional flag *quote* is true, the quotation mark
327-
character (``'"'``) is also translated; this helps for inclusion in an HTML
328-
attribute value, as in ``<A HREF="...">``. If the value to be quoted might
329-
include single- or double-quote characters, or both, consider using the
330-
:func:`quoteattr` function in the :mod:`xml.sax.saxutils` module instead.
327+
character (``"``) is also translated; this helps for inclusion in an HTML
328+
attribute value delimited by double quotes, as in ``<a href="...">``. Note
329+
that single quotes are never translated.
330+
331+
If the value to be quoted might include single- or double-quote characters,
332+
or both, consider using the :func:`quoteattr` function in the
333+
:mod:`xml.sax.saxutils` module instead.
331334

332335

333336
.. _cgi-security:

0 commit comments

Comments
 (0)