lib/onebox/engine/twitter_status_onebox.rb in onebox-1.8.22 vs lib/onebox/engine/twitter_status_onebox.rb in onebox-1.8.23

- old
+ new

@@ -3,11 +3,11 @@ class TwitterStatusOnebox include Engine include LayoutSupport include HTML - matches_regexp /^https?:\/\/(mobile\.|www\.)?twitter\.com\/.+?\/status(es)?\/\d+(\/(video|photo)\/\d?+)?+\/?$/ + matches_regexp(/^https?:\/\/(mobile\.|www\.)?twitter\.com\/.+?\/status(es)?\/\d+(\/(video|photo)\/\d?+)?+\/?$/) always_https private def get_twitter_data @@ -82,12 +82,12 @@ end end def avatar if twitter_api_credentials_present? - access(:user, :profile_image_url_https) - else - twitter_data[:image].gsub!('400x400', 'normal') if twitter_data[:image] + access(:user, :profile_image_url_https).sub('normal', '400x400') + elsif twitter_data[:image] + twitter_data[:image] end end def data { link: link,