mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Replace gsub with tr, delete, or squeeze (#34161).
git-svn-id: http://svn.redmine.org/redmine/trunk@20176 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -895,7 +895,7 @@ module ApplicationHelper
|
||||
# search for the picture in attachments
|
||||
if found = Attachment.latest_attach(attachments, CGI.unescape(filename))
|
||||
image_url = download_named_attachment_url(found, found.filename, :only_path => only_path)
|
||||
desc = found.description.to_s.gsub('"', '')
|
||||
desc = found.description.to_s.delete('"')
|
||||
if !desc.blank? && alttext.blank?
|
||||
alt = " title=\"#{desc}\" alt=\"#{desc}\""
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ module ImportsHelper
|
||||
# Returns the options for the date_format setting
|
||||
def date_format_options
|
||||
Import::DATE_FORMATS.map do |f|
|
||||
format = f.gsub('%', '').gsub(/[dmY]/) do
|
||||
format = f.delete('%').gsub(/[dmY]/) do
|
||||
{'d' => 'DD', 'm' => 'MM', 'Y' => 'YYYY'}[$&]
|
||||
end
|
||||
[format, f]
|
||||
|
||||
@@ -209,7 +209,7 @@ module SettingsHelper
|
||||
def date_format_setting_options(locale)
|
||||
Setting::DATE_FORMATS.map do |f|
|
||||
today = ::I18n.l(User.current.today, :locale => locale, :format => f)
|
||||
format = f.gsub('%', '').gsub(/[dmY]/) do
|
||||
format = f.delete('%').gsub(/[dmY]/) do
|
||||
{'d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy'}[$&]
|
||||
end
|
||||
["#{today} (#{format})", f]
|
||||
|
||||
Reference in New Issue
Block a user