#9700: join filter can't be used with 'safe' filter anymore
--------------------------------------+-------------------------------------
          Reporter:  orzel            |         Owner:  nobody
            Status:  closed           |     Milestone:        
         Component:  Template system  |       Version:  SVN   
        Resolution:  wontfix          |      Keywords:  join  
             Stage:  Unreviewed       |     Has_patch:  0     
        Needs_docs:  0                |   Needs_tests:  0     
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Changes (by mtredinnick):

  * status:  new => closed
  * needs_better_patch:  => 0
  * resolution:  => wontfix
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 The current behaviour is correct; the previous behaviour was broken. This
 is a consequence of r9442, wherein the join filter wasn't handling
 autoescaping of the joining value properly. So join has to do escaping of
 unsafe strings internally (this is the same as other filters that act on
 lists).

 You'll need to mark the strings you're passing in as safe strings (or
 write a filter that applies the safe filter to each element of a list and
 apply that before the join filter) in order to get the previous behaviour.

 Sorry about that, but it's really unavoidable, since join has to be able
 to work with things like "&" as the joiner, hence return a safe string,
 hence do escaping itself, if autoescaping is available.

 I've open #9701 to remind me to think about whether adding a safe-like
 filter that applies elementwise to a list has any big downsides and is
 worth it. There isn't an enormous use-case for it, but it might not hurt.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9700#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to