AnApprentice
AnApprentice

Reputation: 111060

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

Upvotes: 5

Views: 966

Answers (1)

Dylan Markow
Dylan Markow

Reputation: 124449

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

ERB::Util.html_escape now escapes single quotes

Upvotes: 5

Related Questions