Commit 487e524c authored by maeda's avatar maeda
Browse files

Fix indent (#27025).

Patch by Jan Schulz-Hofen.


git-svn-id: https://svn.redmine.org/redmine/trunk@17226 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c02112b9
......@@ -313,7 +313,7 @@ class MailHandler < ActionMailer::Base
if Setting.mail_handler_enable_regex_excluded_filenames?
regexp = %r{\A#{pattern}\z}i
else
regexp = %r{\A#{Regexp.escape(pattern).gsub("\\*", ".*")}\z}i
regexp = %r{\A#{Regexp.escape(pattern).gsub("\\*", ".*")}\z}i
end
if attachment.filename.to_s =~ regexp
logger.info "MailHandler: ignoring attachment #{attachment.filename} matching #{pattern}"
......
......@@ -147,22 +147,22 @@ class Setting < ActiveRecord::Base
[:mail_handler_enable_regex_excluded_filenames, :mail_handler_excluded_filenames, /\s*,\s*/]
].each do |enable_regex, regex_field, delimiter|
if settings.key?(regex_field) || settings.key?(enable_regex)
regexp = Setting.send("#{enable_regex}?")
if settings.key?(enable_regex)
regexp = settings[enable_regex].to_s != '0'
end
if regexp
settings[regex_field].to_s.split(delimiter).each do |value|
begin
Regexp.new(value)
rescue RegexpError => e
messages << [regex_field, "#{l('activerecord.errors.messages.not_a_regexp')} (#{e.message})"]
if settings.key?(regex_field) || settings.key?(enable_regex)
regexp = Setting.send("#{enable_regex}?")
if settings.key?(enable_regex)
regexp = settings[enable_regex].to_s != '0'
end
if regexp
settings[regex_field].to_s.split(delimiter).each do |value|
begin
Regexp.new(value)
rescue RegexpError => e
messages << [regex_field, "#{l('activerecord.errors.messages.not_a_regexp')} (#{e.message})"]
end
end
end
end
end
end
messages
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment