From ceeaeaf487c7312350cff9a7cf4f378c45d690a9 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Thu, 10 Jul 2014 00:24:20 +0200 Subject: [PATCH] better username extraction --- lib/common/models/wp_user/existable.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/common/models/wp_user/existable.rb b/lib/common/models/wp_user/existable.rb index 9fafcdd4..52d0504b 100755 --- a/lib/common/models/wp_user/existable.rb +++ b/lib/common/models/wp_user/existable.rb @@ -68,7 +68,10 @@ class WpUser < WpItem # & are not decoded with Nokogiri title_tag.sub!('&', '&') - name = title_tag[%r{([^|«]+) }, 1] + # replace UTF chars like » with dummy character + title_tag.sub!(/&#(\d+);/, '|') + + name = title_tag[%r{([^|«»]+) }, 1] return name.strip if name end