From f832f0d2c309ac31bbf3616c34495c48509b0fb3 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 30 Oct 2013 08:11:31 -0400 Subject: [PATCH] [1.5.x] Fixed #21316 -- Documented that modifying safe strings makes them unsafe. Thanks dev@simon.net.nz for the suggestion and vijay_shanker for the patch. Backport of 1edef50880 from master --- docs/ref/utils.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 5d234e7883..0ef0a838bf 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -746,6 +746,17 @@ appropriate entities. Can be called multiple times on a single string. + String marked safe will become unsafe again if modified. For example:: + + >>> mystr = 'Hello World ' + >>> mystr = mark_safe(mystr) + >>> type(mystr) + + + >>> mystr = mystr.strip() # removing whitespace + >>> type(mystr) + + .. function:: mark_for_escaping(s) Explicitly mark a string as requiring HTML escaping upon output. Has no