Skip to content

Commit 0e1b9f9

Browse files
committed
Small details
1 parent 01caf16 commit 0e1b9f9

File tree

1 file changed

+3
-3
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+3
-3
lines changed

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def cmd_hosts(*args)
441441
begin
442442
add_host_tag(host_ranges, tag_name)
443443
rescue ::Exception => e
444-
if e.message =~ /Validation failed/
444+
if e.message.include?('Validation failed')
445445
print_error(e.message)
446446
else
447447
raise e
@@ -457,7 +457,7 @@ def cmd_hosts(*args)
457457
framework.db.hosts(framework.db.workspace, onlyup, host_search).each do |host|
458458
if search_term
459459
next unless (
460-
host.attribute_names.any? { |a| host[a.intern].to_s.match(search_term) } or
460+
host.attribute_names.any? { |a| host[a.intern].to_s.match(search_term) } ||
461461
!Mdm::Tag.includes(:hosts).where("hosts.workspace_id = ? and hosts.address = ? and tags.name = ?", framework.db.workspace.id, host.address, search_term.source).order("tags.id DESC").empty?
462462
)
463463
end
@@ -472,7 +472,7 @@ def cmd_hosts(*args)
472472
when "tags"
473473
found_tags = Mdm::Tag.includes(:hosts).where("hosts.workspace_id = ? and hosts.address = ?", framework.db.workspace.id, host.address).order("tags.id DESC")
474474
tag_names = []
475-
found_tags.each {|t| tag_names << t.name}
475+
found_tags.each { |t| tag_names << t.name }
476476
found_tags * ", "
477477
end
478478
# Otherwise, it's just an attribute

0 commit comments

Comments
 (0)