Browse files

use safe_join in number helper

  • Loading branch information...
1 parent 14d1e55 commit 0f848dd54911f0e15c5c3aceabf09582cc6eab16 @lest lest committed Apr 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/number_helper.rb
2 actionpack/lib/action_view/helpers/number_helper.rb
@@ -233,7 +233,7 @@ def number_with_delimiter(number, options = {})
parts = number.to_s.to_str.split('.')
parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{options[:delimiter]}")
- parts.join(options[:separator]).html_safe
+ safe_join(parts, options[:separator])
# Formats a +number+ with the specified level of <tt>:precision</tt> (e.g., 112.32 has a precision

3 comments on commit 0f848dd

Ruby on Rails member

safe_join is required when you need to safely join the intermediate parts, in this case, all the parts are valid and therefore the previous code was valid and likely faster.


@josevalim should we revert it?

Ruby on Rails member
Please sign in to comment.