Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.2.11 encoding issue as it now turns single quotes into html entities?

I recently upgraded from: gem 'rails', '3.2.5' to gem 'rails', '3.2.11'.

I now see the following issue:

Rails View:

MagicThing.set({uuid : <%= "'"+Digest::MD5.hexdigest("#{current_user.id.to_s}#{SITE_CONFIG['key']}")+"'" %>});

With Rails 3.2.5 this would output correctly as:

MagicThing.set({uuid : '6cea6a412094b5633f2011df59bc86b0'});

But now after updating to Rails 3.2.11:

MagicThing.set({uuid : &#x27;6cea6a412094b5633f2011df59bc86b0&#x27;});

Any idea what happened to cause the single quotes to be turned into html entities. And based on that the right way to resolve? Thanks

like image 359
AnApprentice Avatar asked Jan 09 '13 18:01

AnApprentice


1 Answers

Per the changelog, it looks like Rails 3.2.8 changed this:

ERB::Util.html_escape now escapes single quotes

like image 122
Dylan Markow Avatar answered Sep 21 '22 02:09

Dylan Markow