Land #6650, add #strip to #empty to replace #blank

bug/bundler_fix
Adam Cammack 2016-03-08 11:32:02 -06:00
commit 5c770cb5ab
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
9 changed files with 12 additions and 12 deletions

View File

@ -27,7 +27,7 @@ class Memory
def self.heaplib2(custom_js='', opts={})
js = ::File.read(::File.join(Msf::Config.data_directory, "js", "memory", "heaplib2.js"))
unless custom_js.to_s.empty?
unless custom_js.to_s.strip.empty?
js << custom_js
end

View File

@ -126,7 +126,7 @@ class Message
header_string = self.header.to_s
msg = header_string.empty? ? '' : force_crlf(self.header.to_s + "\r\n")
msg << force_crlf(self.content + "\r\n") unless self.content.to_s.empty?
msg << force_crlf(self.content + "\r\n") unless self.content.to_s.strip.empty?
self.parts.each do |part|
msg << force_crlf("--" + self.bound + "\r\n")

View File

@ -59,7 +59,7 @@ module Parser
unless in_tag("JobOrder")
case name
when "OS"
unless @host.nil? or @text.to_s.empty?
unless @host.nil? or @text.to_s.strip.empty?
tnote = {
:type => "host.os.fusionvm_fingerprint",
:data => { :os => @text.strip },
@ -86,7 +86,7 @@ module Parser
when "CVE"
@vuln[:refs] << "CVE-#{@text.strip}"
when "References"
unless @text.to_s.empty?
unless @text.to_s.strip.empty?
@text.split(' ').each do |ref|
next unless ref.start_with? "http"
if ref =~ /MS\d{2}-\d{3}/

View File

@ -469,7 +469,7 @@ class ClientCore < Extension
end
if client.platform =~ /linux/
if writable_dir.to_s.empty?
if writable_dir.to_s.strip.empty?
writable_dir = tmp_folder
end
@ -752,7 +752,7 @@ class ClientCore < Extension
def tmp_folder
tmp = client.sys.config.getenv('TMPDIR')
if tmp.to_s.empty?
if tmp.to_s.strip.empty?
tmp = '/tmp'
end

View File

@ -31,7 +31,7 @@ class Wmi
def query(query, root = nil)
request = Packet.create_request('extapi_wmi_query')
request.add_tlv(TLV_TYPE_EXT_WMI_DOMAIN, root) unless root.to_s.empty?
request.add_tlv(TLV_TYPE_EXT_WMI_DOMAIN, root) unless root.to_s.strip.empty?
request.add_tlv(TLV_TYPE_EXT_WMI_QUERY, query)
response = client.send_request(request)

View File

@ -66,7 +66,7 @@ class Webcam
remote_browser_path = webrtc_browser_path
if remote_browser_path.to_s.empty?
if remote_browser_path.to_s.strip.empty?
fail "Unable to find a suitable browser on the target machine"
end

View File

@ -51,14 +51,14 @@ module Kademlia
bootstrap_peer_id = Rex::Proto::Kademlia.decode_peer_id(message.body.slice!(0, 16))
bootstrap_tcp_port, bootstrap_version, num_peers = message.body.slice!(0, 5).unpack('vCv')
# protocol says there are no peers and the body confirms this, so just return with no peers
if num_peers == 0 && message.body.to_s.empty?
if num_peers == 0 && message.body.to_s.strip.empty?
peers = []
else
peers_data = message.body
# peers data is too long/short, abort
return if peers_data.size % BOOTSTRAP_PEER_SIZE != 0
peers = []
until peers_data.to_s.empty?
until peers_data.to_s.strip.empty?
peer_data = peers_data.slice!(0, BOOTSTRAP_PEER_SIZE)
peer_id = Rex::Proto::Kademlia.decode_peer_id(peer_data.slice!(0, 16))
ip, udp_port, tcp_port, version = peer_data.unpack('VvvC')

View File

@ -116,7 +116,7 @@ class CentralDir
end
def pack
if @entry.central_dir_name.to_s.empty?
if @entry.central_dir_name.to_s.strip.empty?
path = @entry.relative_path
else
path = @entry.central_dir_path

View File

@ -76,7 +76,7 @@ class Entry
end
def central_dir_path
return nil if @central_dir_name.to_s.empty?
return nil if @central_dir_name.to_s.strip.empty?
get_relative_path(@central_dir_name)
end