summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-01-30 15:18:24 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-01-30 15:18:24 +0000
commitd74d181a491ff3e6eed1d5e8e9c1d00e7b124513 (patch)
tree46acea4db4a5de2b67fa7f779cf407d373db0809
parent63dabf9311ea5682de4487e28b85f5c1b73bd0fe (diff)
utils: fix decode_html_entities for numerical entities without HTMLEntities
-rw-r--r--lib/rbot/core/utils/utils.rb6
1 files 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