Browse files

Don't destructively modify SafeBuffers

  • Loading branch information...
1 parent 792b155 commit 736de9c2a130567623728dd7f9933a5e11039716 @urkle urkle committed Aug 12, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/helpers/authorization_rules_helper.rb
View
2 app/helpers/authorization_rules_helper.rb
@@ -13,7 +13,7 @@ def syntax_highlight (rules)
}
regexps.each do |name, res|
res.each do |re|
- rules.gsub!(
+ rules = rules.gsub(
re.is_a?(String) ? Regexp.new("(^|[^:])\\b(#{Regexp.escape(re)})\\b") :
(re.is_a?(Symbol) ? Regexp.new("()(:#{Regexp.escape(re.to_s)})\\b") : re),
"\\1<span class=\"#{name}\">\\2</span>")

0 comments on commit 736de9c

Please sign in to comment.