summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-10-24 06:46:50 +0000
committerGo MAEDA <maeda@farend.jp>2020-10-24 06:46:50 +0000
commit78dfef097803532fee664461f6485175917c1990 (patch)
tree9442d8a37c382e347c1928c250b1d939b8ae6ee6 /lib/redmine
parentb46953247da61845d7cd4600435c21012409aafb (diff)
downloadredmine-78dfef097803532fee664461f6485175917c1990.tar.gz
redmine-78dfef097803532fee664461f6485175917c1990.zip
Replace gsub with tr, delete, or squeeze (#34161).
git-svn-id: http://svn.redmine.org/redmine/trunk@20176 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/core_ext/string/conversions.rb2
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/core_ext/string/conversions.rb b/lib/redmine/core_ext/string/conversions.rb
index a6ff884ec..c52b334e4 100644
--- a/lib/redmine/core_ext/string/conversions.rb
+++ b/lib/redmine/core_ext/string/conversions.rb
@@ -38,7 +38,7 @@ module Redmine
s.gsub!(%r{^((\d+)\s*(h|hours?))?\s*((\d+)\s*(m|min)?)?$}i) { |m| ($1 || $4) ? ($2.to_i + $5.to_i / 60.0) : m[0] }
end
# 2,5 => 2.5
- s.gsub!(',', '.')
+ s.tr!(',', '.')
begin; Kernel.Float(s); rescue; nil; end
end
end
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index b47296b1b..3c43a54d9 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -1016,7 +1016,7 @@ class RedCloth3 < String
def clean_white_space( text )
# normalize line breaks
text.gsub!( /\r\n/, "\n" )
- text.gsub!( /\r/, "\n" )
+ text.tr!( "\r", "\n" )
text.gsub!( /\t/, ' ' )
text.gsub!( /^ +$/, '' )
text.gsub!( /\n{3,}/, "\n\n" )