mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-03 22:31:34 +00:00
Minor patch
This commit is contained in:
parent
0a8a65bc0b
commit
459130196a
3 changed files with 14 additions and 2 deletions
|
|
@ -198,8 +198,20 @@ def decodeBase64(value, binary=True, encoding=None):
|
|||
True
|
||||
>>> decodeBase64("MTIz", binary=False)
|
||||
'123'
|
||||
>>> decodeBase64(b"MTIzNA") == b"1234"
|
||||
True
|
||||
>>> decodeBase64("MTIzNA") == b"1234"
|
||||
True
|
||||
>>> decodeBase64("MTIzNA==") == b"1234"
|
||||
True
|
||||
"""
|
||||
|
||||
padding = b'=' if isinstance(value, bytes) else '='
|
||||
|
||||
# Reference: https://stackoverflow.com/a/49459036
|
||||
if not value.endswith(padding):
|
||||
value += 3 * padding
|
||||
|
||||
retVal = base64.b64decode(value)
|
||||
|
||||
if not binary:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue