Patch #20369 ยป replace-downcase-with-casecmp.diff
| app/controllers/account_controller.rb (working copy) | ||
|---|---|---|
|
token = Token.new(:user => user, :action => "recovery")
|
||
|
if token.save
|
||
|
# Don't use the param to send the email
|
||
|
recipent = user.mails.detect {|e| e.downcase == email.downcase} || user.mail
|
||
|
recipent = user.mails.detect {|e| email.casecmp(e) == 0} || user.mail
|
||
|
Mailer.lost_password(token, recipent).deliver
|
||
|
flash[:notice] = l(:notice_account_lost_email_sent)
|
||
|
redirect_to signin_path
|
||
| app/helpers/application_helper.rb (working copy) | ||
|---|---|---|
|
parsed << text
|
||
|
if tag
|
||
|
if closing
|
||
|
if tags.last == tag.downcase
|
||
|
if tags.last.casecmp(tag) == 0
|
||
|
tags.pop
|
||
|
end
|
||
|
else
|
||
| app/models/attachment.rb (working copy) | ||
|---|---|---|
|
def self.latest_attach(attachments, filename)
|
||
|
attachments.sort_by(&:created_on).reverse.detect do |att|
|
||
|
att.filename.downcase == filename.downcase
|
||
|
filename.casecmp(att.filename) == 0
|
||
|
end
|
||
|
end
|
||
| app/models/custom_field.rb (working copy) | ||
|---|---|---|
|
possible_values_options = possible_values_options(customized)
|
||
|
if possible_values_options.present?
|
||
|
keyword = keyword.to_s.downcase
|
||
|
if v = possible_values_options.detect {|text, id| text.downcase == keyword}
|
||
|
if v = possible_values_options.detect {|text, id| keyword.casecmp(text) == 0}
|
||
|
if v.is_a?(Array)
|
||
|
v.last
|
||
|
else
|
||
| app/models/mail_handler.rb (working copy) | ||
|---|---|---|
|
@handler_options = options
|
||
|
sender_email = email.from.to_a.first.to_s.strip
|
||
|
# Ignore emails received from the application emission address to avoid hell cycles
|
||
|
if sender_email.downcase == Setting.mail_from.to_s.strip.downcase
|
||
|
if sender_email.casecmp(Setting.mail_from.to_s.strip) == 0
|
||
|
if logger
|
||
|
logger.info "MailHandler: ignoring email from Redmine emission address [#{sender_email}]"
|
||
|
end
|
||
| ... | ... | |
|
assignable = issue.assignable_users
|
||
|
assignee = nil
|
||
|
assignee ||= assignable.detect {|a|
|
||
|
a.mail.to_s.downcase == keyword ||
|
||
|
a.login.to_s.downcase == keyword
|
||
|
keyword.casecmp(a.mail.to_s) == 0 ||
|
||
|
keyword.casecmp(a.login.to_s) == 0
|
||
|
}
|
||
|
if assignee.nil? && keyword.match(/ /)
|
||
|
firstname, lastname = *(keyword.split) # "First Last Throwaway"
|
||
|
assignee ||= assignable.detect {|a|
|
||
|
a.is_a?(User) && a.firstname.to_s.downcase == firstname &&
|
||
|
a.lastname.to_s.downcase == lastname
|
||
|
a.is_a?(User) &&
|
||
|
firstname.casecmp(a.firstname.to_s) == 0 &&
|
||
|
lastname.casecmp(a.lastname.to_s) == 0
|
||
|
}
|
||
|
end
|
||
|
if assignee.nil?
|
||
|
assignee ||= assignable.detect {|a| a.name.downcase == keyword}
|
||
|
assignee ||= assignable.detect {|a| keyword.casecmp(a.name) == 0}
|
||
|
end
|
||
|
assignee
|
||
|
end
|
||
| app/models/principal.rb (working copy) | ||
|---|---|---|
|
if principal.nil?
|
||
|
-1
|
||
|
elsif self.class.name == principal.class.name
|
||
|
self.to_s.downcase <=> principal.to_s.downcase
|
||
|
self.to_s.casecmp(principal.to_s)
|
||
|
else
|
||
|
# groups after users
|
||
|
principal.class.name <=> self.class.name
|
||
| app/models/project.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
def <=>(project)
|
||
|
name.downcase <=> project.name.downcase
|
||
|
name.casecmp(project.name)
|
||
|
end
|
||
|
def to_s
|
||