Oops escape everything but image urls

This commit is contained in:
Robin Ward 2013-03-08 16:17:56 -05:00
parent 908bba8c13
commit 4c7b0a42b5
2 changed files with 4 additions and 3 deletions

View File

@ -45,8 +45,9 @@ module ApplicationHelper
result << tag(:meta, property: 'twitter:card', content: "summary")
[:image, :url, :title, :description].each do |property|
if opts[property].present?
result << tag(:meta, {property: "og:#{property}", content: opts[property]}, nil, false) << "\n"
result << tag(:meta, {property: "twitter:#{property}", content: opts[property]}, nil, false) << "\n"
escape = (property != :image)
result << tag(:meta, {property: "og:#{property}", content: opts[property]}, nil, escape) << "\n"
result << tag(:meta, {property: "twitter:#{property}", content: opts[property]}, nil, escape) << "\n"
end
end

View File

@ -322,7 +322,7 @@ class User < ActiveRecord::Base
# Don't pass this up to the client - it's meant for server side use
def small_avatar_url
"https://www.gravatar.com/avatar/#{email_hash}.png?s=50&r=pg&d=identicon"
"https://www.gravatar.com/avatar/#{email_hash}.png?s=200&r=pg&d=identicon"
end
# return null for local avatars, a template for gravatar