Skip to content

Commit a22db07

Browse files
committed
Appease rubocop
1 parent 24750de commit a22db07

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/encoders/php/hex.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def initialize
2121
[
2222
OptBool.new('Compress', [ true, 'Compress the payload with zlib', false ]) # Disabled by default as it relies on having php compiled with zlib, which might not be available on come exotic setups.
2323
],
24-
self.class)
24+
self.class
25+
)
2526
end
2627

2728
def encode_block(state, buf)
@@ -55,12 +56,12 @@ def encode_block(state, buf)
5556
# Last ditch effort, if any of the normal characters used by hex
5657
# are badchars, try to replace them with something that will become
5758
# the appropriate thing on the other side.
58-
if hex.include?(byte.chr)
59-
%w[c h r ( ) .].uniq.each do |c|
60-
raise BadcharError if state.badchars.include?(c)
61-
end
62-
hex.gsub!(byte.chr, "#{quote}.chr(#{byte}).#{quote}")
59+
next unless hex.include?(byte.chr)
60+
61+
%w[c h r ( ) .].uniq.each do |c|
62+
raise BadcharError if state.badchars.include?(c)
6363
end
64+
hex.gsub!(byte.chr, "#{quote}.chr(#{byte}).#{quote}")
6465
end
6566

6667
if datastore['Compress']

0 commit comments

Comments
 (0)