Rex shouldn't die when trying to Rex::Text.base64_encode(nil). It should return an empty string.

git-svn-id: file:///home/svn/framework3/trunk@13817 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Tod Beardsley 2011-10-05 01:42:14 +00:00
parent c97fc2c683
commit b21acdaaae
1 changed files with 2 additions and 2 deletions

View File

@ -681,14 +681,14 @@ module Text
# Base64 encoder
#
def self.encode_base64(str, delim='')
[str].pack("m").gsub(/\s+/, delim)
[str.to_s].pack("m").gsub(/\s+/, delim)
end
#
# Base64 decoder
#
def self.decode_base64(str)
str.unpack("m")[0]
str.to_s.unpack("m")[0]
end
#