Skip to content

Commit 656c8fd

Browse files
committed
Remove some useless code in modules/encoders/php/base64.rb
The payload is always quoted since 975de9d, so there is no need to care if the first character is alpha or not. This has some chance to make the payload 5 chars smaller, woo!
1 parent e0037fb commit 656c8fd

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

modules/encoders/php/base64.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ def encode_block(state, buf)
5656
# raw string, so strip it off.
5757
b64.gsub!(/[=\n]+/, '')
5858

59-
# The first character must not be a non-alpha character or PHP chokes.
60-
i = 0
61-
b64[i] = "chr(#{b64[i]})." while (b64[i].chr =~ %r{[0-9/+]})
62-
6359
# Similarly, when we separate large payloads into chunks to avoid the
6460
# 998-byte problem mentioned above, we have to make sure that the first
6561
# character of each chunk is an alpha character. This simple algorithm

0 commit comments

Comments
 (0)