From 479b21a7227fe1364e7a94b343f928dc7f5773cf Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Thu, 10 Jul 2014 00:30:33 +0200 Subject: [PATCH] Replace all occurences --- lib/common/models/wp_user/existable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/models/wp_user/existable.rb b/lib/common/models/wp_user/existable.rb index 52d0504b..7d547017 100755 --- a/lib/common/models/wp_user/existable.rb +++ b/lib/common/models/wp_user/existable.rb @@ -66,10 +66,10 @@ class WpUser < WpItem title_tag.force_encoding('UTF-8') if title_tag.encoding == Encoding::ASCII_8BIT title_tag = Nokogiri::HTML::DocumentFragment.parse(title_tag).to_s # & are not decoded with Nokogiri - title_tag.sub!('&', '&') + title_tag.gsub!('&', '&') # replace UTF chars like » with dummy character - title_tag.sub!(/&#(\d+);/, '|') + title_tag.gsub!(/&#(\d+);/, '|') name = title_tag[%r{([^|«»]+) }, 1]