Fix for issue 1553 - escape_javascript to support SafeBuffer strings #1558

Merged
merged 1 commit into from Jun 8, 2011

Projects

None yet

3 participants

@tardate
Contributor
tardate commented Jun 8, 2011

Seems like no-one has pushed the fix yet, so here's my shot.

This fixes escape_javascript to allow for the fact that gsub on SafeBuffer does not pass match variables $1, $2 etc to a block. See issue GH#1553

It doesn't fix the fact that gsub on a SafeBuffer still behaves differently from ruby core gsub when given a block (issue GH#1555)

@tardate tardate Make escape_javascript happy to handle SafeBuffers
* see GH#1553
* allow for the fact that gsub on SafeBuffer does not pass match variables $1, $2 etc to a block
75ecdfb
@sikachu
Member
sikachu commented Jun 8, 2011

@josevalim bro, please get this one in. Looks good to me.

@josevalim josevalim merged commit 910b34d into rails:3-0-stable Jun 8, 2011
@josevalim
Member

We need to port this to 3-1-stable and master as well, right?

@sikachu
Member
sikachu commented Jun 8, 2011

Yep, I'm doing it now.

@sikachu
Member
sikachu commented Jun 8, 2011

This has been ported in #1560 and #1561. Thank you for fixing this :)

@jake3030 jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011
@fcheung @josh fcheung + josh Fixed session related memory leak [#1558 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
5ede4ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment