From d74d181a491ff3e6eed1d5e8e9c1d00e7b124513 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 30 Jan 2008 15:18:24 +0000 Subject: utils: fix decode_html_entities for numerical entities without HTMLEntities --- lib/rbot/core/utils/utils.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index 535ae190..ba3a4f24 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -272,12 +272,12 @@ module ::Irc str.gsub(/(&(.+?);)/) { symbol = $2 # remove the 0-paddng from unicode integers - if symbol =~ /#(.+)/ - symbol = "##{$1.to_i.to_s}" + if symbol =~ /^#(\d+)$/ + symbol = $1.to_i.to_s end # output the symbol's irc-translated character, or a * if it's unknown - UNESCAPE_TABLE[symbol] || (symbol.match(/^\d+$/) ? [$0.to_i].pack("U") : '*') + UNESCAPE_TABLE[symbol] || (symbol.match(/^\d+$/) ? [symbol.to_i].pack("U") : '*') } end end -- cgit v1.2.3