Seems like no-one has pushed the fix yet, so here's my shot.
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)
* see GH#1553
* allow for the fact that gsub on SafeBuffer does not pass match variables $1, $2 etc to a block
@josevalim bro, please get this one in. Looks good to me.
We need to port this to 3-1-stable and master as well, right?
Yep, I'm doing it now.
This has been ported in #1560 and #1561. Thank you for fixing this :)
Fixed session related memory leak [#1558 state:resolved]
Signed-off-by: Joshua Peek <email@example.com>