fixed the safe_buffer issues

This commit is contained in:
Maxwell Salzberg 2011-07-12 18:15:56 -07:00 committed by Raphael Sofaer
parent 1ba49caeca
commit df62f58156
7 changed files with 50 additions and 47 deletions

View file

@ -3,7 +3,7 @@ source 'http://rubygems.org'
gem 'mysql2', '0.2.6' gem 'mysql2', '0.2.6'
#gem 'pg' #gem 'pg'
#gem 'sqlite3' #gem 'sqlite3'
gem 'rails', '3.0.3' gem 'rails', '3.0.9'
gem 'foreigner', '0.9.1' gem 'foreigner', '0.9.1'
gem 'activerecord-import' gem 'activerecord-import'
@ -32,7 +32,8 @@ gem 'faraday'
gem 'faraday-stack' gem 'faraday-stack'
#Views #Views
gem 'haml', '3.0.25' gem 'haml', '3.1.2'
gem 'sass', '3.1.4'
gem 'will_paginate', '3.0.pre2' gem 'will_paginate', '3.0.pre2'
#Localization #Localization

View file

@ -72,34 +72,41 @@ GEM
Platform (0.4.0) Platform (0.4.0)
SystemTimer (1.2.1) SystemTimer (1.2.1)
abstract (1.0.0) abstract (1.0.0)
actionmailer (3.0.3) actionmailer (3.0.9)
actionpack (= 3.0.3) actionpack (= 3.0.9)
mail (~> 2.2.9) mail (~> 2.2.19)
actionpack (3.0.3) actionpack (3.0.9)
activemodel (= 3.0.3) activemodel (= 3.0.9)
activesupport (= 3.0.3) activesupport (= 3.0.9)
builder (~> 2.1.2) builder (~> 2.1.2)
erubis (~> 2.6.6) erubis (~> 2.6.6)
i18n (~> 0.4) i18n (~> 0.5.0)
rack (~> 1.2.1) rack (~> 1.2.1)
rack-mount (~> 0.6.13) rack-mount (~> 0.6.14)
rack-test (~> 0.5.6) rack-test (~> 0.5.7)
tzinfo (~> 0.3.23) tzinfo (~> 0.3.23)
activemodel (3.0.3) activemodel (3.0.9)
activesupport (= 3.0.3) activesupport (= 3.0.9)
builder (~> 2.1.2) builder (~> 2.1.2)
i18n (~> 0.4) i18n (~> 0.5.0)
activerecord (3.0.3) activerecord (3.0.9)
activemodel (= 3.0.3) activemodel (= 3.0.9)
activesupport (= 3.0.3) activesupport (= 3.0.9)
arel (~> 2.0.2) arel (~> 2.0.10)
tzinfo (~> 0.3.23) tzinfo (~> 0.3.23)
<<<<<<< HEAD
activerecord-import (0.2.7) activerecord-import (0.2.7)
activerecord (~> 3.0.0) activerecord (~> 3.0.0)
activeresource (3.0.3) activeresource (3.0.3)
activemodel (= 3.0.3) activemodel (= 3.0.3)
activesupport (= 3.0.3) activesupport (= 3.0.3)
activesupport (3.0.3) activesupport (3.0.3)
=======
activeresource (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
activesupport (3.0.9)
>>>>>>> fixed the safe_buffer issues
addressable (2.2.4) addressable (2.2.4)
archive-tar-minitar (0.5.2) archive-tar-minitar (0.5.2)
arel (2.0.10) arel (2.0.10)
@ -209,11 +216,11 @@ GEM
gem_plugin (0.2.3) gem_plugin (0.2.3)
gherkin (2.3.10) gherkin (2.3.10)
json (>= 1.4.6) json (>= 1.4.6)
haml (3.0.25) haml (3.1.2)
hashie (1.0.0) hashie (1.0.0)
highline (1.6.2) highline (1.6.2)
http_connection (1.4.1) http_connection (1.4.1)
i18n (0.6.0) i18n (0.5.0)
i18n-inflector (2.6.1) i18n-inflector (2.6.1)
i18n (>= 0.4.1) i18n (>= 0.4.1)
i18n-inflector-rails (1.0.4) i18n-inflector-rails (1.0.4)
@ -328,25 +335,27 @@ GEM
ruby-openid (>= 2.1.8) ruby-openid (>= 2.1.8)
rack-test (0.5.7) rack-test (0.5.7)
rack (>= 1.0) rack (>= 1.0)
rails (3.0.3) rails (3.0.9)
actionmailer (= 3.0.3) actionmailer (= 3.0.9)
actionpack (= 3.0.3) actionpack (= 3.0.9)
activerecord (= 3.0.3) activerecord (= 3.0.9)
activeresource (= 3.0.3) activeresource (= 3.0.9)
activesupport (= 3.0.3) activesupport (= 3.0.9)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.0.3) railties (= 3.0.9)
rails-i18n (0.1.0) rails-i18n (0.1.0)
activesupport (~> 3) activesupport (~> 3)
railties (3.0.3) railties (3.0.9)
actionpack (= 3.0.3) actionpack (= 3.0.9)
activesupport (= 3.0.3) activesupport (= 3.0.9)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4) thor (~> 0.14.4)
rake (0.9.2) rake (0.9.2)
rash (0.3.0) rash (0.3.0)
hashie (~> 1.0.0) hashie (~> 1.0.0)
rcov (0.9.9) rcov (0.9.9)
rdoc (3.8)
redis (2.2.0) redis (2.2.0)
redis-namespace (0.8.0) redis-namespace (0.8.0)
redis (< 3.0.0) redis (< 3.0.0)
@ -396,6 +405,7 @@ GEM
archive-tar-minitar (>= 0.5.2) archive-tar-minitar (>= 0.5.2)
rubyntlm (0.1.1) rubyntlm (0.1.1)
rubyzip (0.9.4) rubyzip (0.9.4)
sass (3.1.4)
selenium-webdriver (0.2.2) selenium-webdriver (0.2.2)
childprocess (>= 0.1.9) childprocess (>= 0.1.9)
ffi (>= 1.0.7) ffi (>= 1.0.7)
@ -475,7 +485,7 @@ DEPENDENCIES
fog (= 0.3.25) fog (= 0.3.25)
foreigner (= 0.9.1) foreigner (= 0.9.1)
fuubar fuubar
haml (= 3.0.25) haml (= 3.1.2)
http_accept_language! http_accept_language!
i18n-inflector-rails (~> 1.0) i18n-inflector-rails (~> 1.0)
jammit (= 0.5.4) jammit (= 0.5.4)
@ -492,7 +502,7 @@ DEPENDENCIES
oauth2-provider (= 0.0.16) oauth2-provider (= 0.0.16)
ohai (= 0.5.8) ohai (= 0.5.8)
omniauth (= 0.2.6) omniauth (= 0.2.6)
rails (= 3.0.3) rails (= 3.0.9)
rails-i18n rails-i18n
rcov rcov
resque (= 1.10.0) resque (= 1.10.0)
@ -505,6 +515,7 @@ DEPENDENCIES
rspec-rails (>= 2.0.0) rspec-rails (>= 2.0.0)
ruby-debug ruby-debug
ruby-debug19 ruby-debug19
sass (= 3.1.4)
selenium-webdriver (= 0.2.2) selenium-webdriver (= 0.2.2)
settingslogic (= 2.0.6) settingslogic (= 2.0.6)
sod! sod!

View file

@ -55,6 +55,7 @@ class InvitationsController < Devise::InvitationsController
user.accept_invitation!(params[:user]) user.accept_invitation!(params[:user])
user.seed_aspects user.seed_aspects
rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so. rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so.
raise e
user = nil user = nil
record = e.record record = e.record
record.errors.delete(:person) record.errors.delete(:person)

View file

@ -4,7 +4,7 @@
module MarkdownifyHelper module MarkdownifyHelper
def markdownify(message, options={}) def markdownify(message, options={})
message = h(message).html_safe message = h(message).to_str
options[:newlines] = true if !options.has_key?(:newlines) options[:newlines] = true if !options.has_key?(:newlines)
options[:specialchars] = true if !options.has_key?(:specialchars) options[:specialchars] = true if !options.has_key?(:specialchars)
@ -17,7 +17,7 @@ module MarkdownifyHelper
message = process_specialchars(message) if options[:specialchars] message = process_specialchars(message) if options[:specialchars]
message = process_newlines(message) if options[:newlines] message = process_newlines(message) if options[:newlines]
message message.html_safe
end end
def process_newlines(message) def process_newlines(message)

View file

@ -47,7 +47,7 @@ class StatusMessage < Post
def format_mentions(text, opts = {}) def format_mentions(text, opts = {})
regex = /@\{([^;]+); ([^\}]+)\}/ regex = /@\{([^;]+); ([^\}]+)\}/
form_message = text.gsub(regex) do |matched_string| form_message = text.to_str.gsub(regex) do |matched_string|
people = self.mentioned_people people = self.mentioned_people
person = people.detect{ |p| person = people.detect{ |p|
p.diaspora_handle == $~[2] unless p.nil? p.diaspora_handle == $~[2] unless p.nil?

View file

@ -14,13 +14,3 @@ AVAILABLE_LANGUAGE_CODES.each do |c|
I18n.fallbacks[c.to_sym] = [c.to_sym, DEFAULT_LANGUAGE.to_sym, :en] I18n.fallbacks[c.to_sym] = [c.to_sym, DEFAULT_LANGUAGE.to_sym, :en]
end end
end end
# Workaround for https://rails.lighthouseapp.com/projects/8994/tickets/5329-using-i18nwith_locale-in-actionmailer-raises-systemstackerror
module AbstractController
class I18nProxy
def initialize(i18n_config, lookup_context)
@i18n_config, @lookup_context = i18n_config, lookup_context
@i18n_config = @i18n_config.i18n_config if @i18n_config.respond_to?(:i18n_config)
end
end
end

View file

@ -42,7 +42,7 @@ module Diaspora
return text if opts[:plain_text] return text if opts[:plain_text]
text = ERB::Util.h(text) unless opts[:no_escape] text = ERB::Util.h(text) unless opts[:no_escape]
regex = /(^|\s)#(#{VALID_TAG_BODY})/ regex = /(^|\s)#(#{VALID_TAG_BODY})/
form_message = text.gsub(regex) do |matched_string| form_message = text.to_str.gsub(regex) do |matched_string|
"#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>" "#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>"
end end
form_message.html_safe form_message.html_safe