Project

General

Profile

Patch #13763 » valid_host_name.patch

Filou Centrinov, 2013-04-14 21:20

View differences:

config/settings.yml (working copy)
71 71
  default: en
72 72
host_name:
73 73
  default: localhost:3000
74
  regexp: '^((.*:\/\/)?(www\.)?([\./:@]*)?)'  
74 75
protocol:
75 76
  default: http
76 77
feeds_limit:
77 78

  
78 79

  
app/models/setting.rb (working copy)
94 94
    # Unserialize serialized settings
95 95
    v = YAML::load(v) if @@available_settings[name]['serialized'] && v.is_a?(String)
96 96
    v = v.to_sym if @@available_settings[name]['format'] == 'symbol' && !v.blank?
97
    v = v.gsub(/#{@@available_settings[name]['regexp']}/i,'') if !@@available_settings[name]['regexp'].blank? && !v.blank?	
97 98
    v
98 99
  end
99 100

  
100 101

  
(3-3/3)