Commit e9c0b88b7d5fadcfff84a4754d7df90c1469fb88
1 parent
4c3e514f
Exists in
master
and in
29 other branches
Adding some more sites to trusted sites for iframe
- Also, removing some re-definition of Environment model at old migrations that causes error when trying to save Environment instances (ActionItem2051)
Showing
7 changed files
with
29 additions
and
15 deletions
Show diff stats
app/models/environment.rb
@@ -226,7 +226,19 @@ class Environment < ActiveRecord::Base | @@ -226,7 +226,19 @@ class Environment < ActiveRecord::Base | ||
226 | settings_items :currency_separator, :type => String, :default => '.' | 226 | settings_items :currency_separator, :type => String, :default => '.' |
227 | settings_items :currency_delimiter, :type => String, :default => ',' | 227 | settings_items :currency_delimiter, :type => String, :default => ',' |
228 | 228 | ||
229 | - settings_items :trusted_sites_for_iframe, :type => Array, :default => ['itheora.org', 'tv.softwarelivre.org', 'stream.softwarelivre.org', 'www.youtube.com', 'player.vimeo.com'] | 229 | + settings_items :trusted_sites_for_iframe, :type => Array, :default => %w[ |
230 | + developer.myspace.com | ||
231 | + itheora.org | ||
232 | + maps.google.com | ||
233 | + platform.twitter.com | ||
234 | + player.vimeo.com | ||
235 | + stream.softwarelivre.org | ||
236 | + tv.softwarelivre.org | ||
237 | + www.facebook.com | ||
238 | + www.flickr.com | ||
239 | + www.gmodules.com | ||
240 | + www.youtube.com | ||
241 | + ] + ('a' .. 'z').map{|i| "#{i}.yimg.com"} | ||
230 | 242 | ||
231 | settings_items :enabled_plugins, :type => Array, :default => [] | 243 | settings_items :enabled_plugins, :type => Array, :default => [] |
232 | 244 |
db/migrate/069_add_enviroment_id_to_role.rb
db/migrate/083_set_visible_to_profiles.rb
db/migrate/20110706171330_fix_misunderstood_script_filename.rb
@@ -21,12 +21,6 @@ class ArticleSweeper < ActiveRecord::Observer | @@ -21,12 +21,6 @@ class ArticleSweeper < ActiveRecord::Observer | ||
21 | end | 21 | end |
22 | end | 22 | end |
23 | 23 | ||
24 | -class Environment < ActiveRecord::Base | ||
25 | - def self.verify_filename(filename) | ||
26 | - filename | ||
27 | - end | ||
28 | -end | ||
29 | - | ||
30 | class FixMisunderstoodScriptFilename < ActiveRecord::Migration | 24 | class FixMisunderstoodScriptFilename < ActiveRecord::Migration |
31 | def self.up | 25 | def self.up |
32 | Image.all.select { |i| !i.thumbnail? && File.extname(i.filename) == '.txt'}.map do |image| | 26 | Image.all.select { |i| !i.thumbnail? && File.extname(i.filename) == '.txt'}.map do |image| |
db/migrate/20110728173905_add_more_trusted_sites_for_environments.rb
0 → 100644
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +class AddMoreTrustedSitesForEnvironments < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + default_sites = Environment.new.trusted_sites_for_iframe | ||
4 | + Environment.all.each do |env| | ||
5 | + env.trusted_sites_for_iframe += default_sites | ||
6 | + env.trusted_sites_for_iframe.uniq! | ||
7 | + env.save! | ||
8 | + end | ||
9 | + end | ||
10 | + | ||
11 | + def self.down | ||
12 | + say 'Warning: This migration cant recover old data' | ||
13 | + end | ||
14 | +end |
db/schema.rb
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | # | 9 | # |
10 | # It's strongly recommended to check this file into your version control system. | 10 | # It's strongly recommended to check this file into your version control system. |
11 | 11 | ||
12 | -ActiveRecord::Schema.define(:version => 20110714213405) do | 12 | +ActiveRecord::Schema.define(:version => 20110728173905) do |
13 | 13 | ||
14 | create_table "action_tracker", :force => true do |t| | 14 | create_table "action_tracker", :force => true do |t| |
15 | t.integer "user_id" | 15 | t.integer "user_id" |
test/unit/environment_test.rb
@@ -1071,7 +1071,7 @@ class EnvironmentTest < Test::Unit::TestCase | @@ -1071,7 +1071,7 @@ class EnvironmentTest < Test::Unit::TestCase | ||
1071 | end | 1071 | end |
1072 | 1072 | ||
1073 | should 'have a list of trusted sites by default' do | 1073 | should 'have a list of trusted sites by default' do |
1074 | - assert_equal ['itheora.org', 'tv.softwarelivre.org', 'stream.softwarelivre.org', 'www.youtube.com', 'player.vimeo.com'], Environment.new.trusted_sites_for_iframe | 1074 | + assert_equal ['developer.myspace.com', 'itheora.org', 'maps.google.com', 'platform.twitter.com', 'player.vimeo.com', 'stream.softwarelivre.org', 'tv.softwarelivre.org', 'www.facebook.com', 'www.flickr.com', 'www.gmodules.com', 'www.youtube.com', 'a.yimg.com', 'b.yimg.com', 'c.yimg.com', 'd.yimg.com', 'e.yimg.com', 'f.yimg.com', 'g.yimg.com', 'h.yimg.com', 'i.yimg.com', 'j.yimg.com', 'k.yimg.com', 'l.yimg.com', 'm.yimg.com', 'n.yimg.com', 'o.yimg.com', 'p.yimg.com', 'q.yimg.com', 'r.yimg.com', 's.yimg.com', 't.yimg.com', 'u.yimg.com', 'v.yimg.com', 'w.yimg.com', 'x.yimg.com', 'y.yimg.com', 'z.yimg.com'], Environment.new.trusted_sites_for_iframe |
1075 | end | 1075 | end |
1076 | 1076 | ||
1077 | should 'have a list of trusted sites' do | 1077 | should 'have a list of trusted sites' do |