Merge pull request #2284 from jaimeiniesta/patch-1

escape gravatar URLs to comply with W3C standards
This commit is contained in:
Sam 2014-04-24 12:56:16 +10:00
commit a6b88d1e7e
2 changed files with 2 additions and 2 deletions

View File

@ -335,7 +335,7 @@ class User < ActiveRecord::Base
def self.gravatar_template(email)
email_hash = self.email_hash(email)
"//www.gravatar.com/avatar/#{email_hash}.png?s={size}&r=pg&d=identicon"
"//www.gravatar.com/avatar/#{email_hash}.png?s={size}&amp;r=pg&amp;d=identicon"
end
# Don't pass this up to the client - it's meant for server side use

View File

@ -969,7 +969,7 @@ describe User do
describe "#gravatar_template" do
it "returns a gravatar based template" do
User.gravatar_template("em@il.com").should == "//www.gravatar.com/avatar/6dc2fde946483a1d8a84b89345a1b638.png?s={size}&r=pg&d=identicon"
User.gravatar_template("em@il.com").should == "//www.gravatar.com/avatar/6dc2fde946483a1d8a84b89345a1b638.png?s={size}&amp;r=pg&amp;d=identicon"
end
end