From 01c444e17a36b8ddf3d8a728f4e39093c1908f6a Mon Sep 17 00:00:00 2001 From: Marek Skrobacki Date: Thu, 18 Aug 2016 12:42:07 +0100 Subject: [PATCH] allow dots in the hostnames Without this, the arguments array is populated incorrectly. For example: !host server.xyz.com would execute `Zabbix::Host.get('search' => { name: 'server' })` which would obviously return incorrect number of results, because it would match both `server.xyz.com` and `server.abc.com.` --- lib/zabbirc/irc/base_command.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zabbirc/irc/base_command.rb b/lib/zabbirc/irc/base_command.rb index f628150..0915941 100644 --- a/lib/zabbirc/irc/base_command.rb +++ b/lib/zabbirc/irc/base_command.rb @@ -21,8 +21,8 @@ def initialize ops, message, cmd end def parse_arguments cmd - cmd.scan(/'[a-zA-Z0-9_\-,# ]+'|[a-zA-Z0-9_\-,#]+/).collect do |x| - x.match(/[a-zA-Z0-9_\-,# ]+/)[0] + cmd.scan(/'[a-zA-Z0-9_\-\.,# ]+'|[a-zA-Z0-9_\-\.,#]+/).collect do |x| + x.match(/[a-zA-Z0-9_\-\.,# ]+/)[0] end end