X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/1394469c06e6908e6e77b48718ce6664db23407c..f89474388394d7a7fd7dbb41f089956454e4957f:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index 9a9df71..87d2cff 100755 --- a/lib/functions.php +++ b/lib/functions.php @@ -39,22 +39,22 @@ function base_16_to_64 ($num) { $m = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'; - $hex2bin = ['0000', # 0 - '0001', # 1 - '0010', # 2 - '0011', # 3 - '0100', # 4 - '0101', # 5 - '0110', # 6 - '0111', # 7 - '1000', # 8 - '1001', # 9 - '1010', # a - '1011', # b - '1100', # c - '1101', # d - '1110', # e - '1111']; # f + $hex2bin = array ('0000', # 0 + '0001', # 1 + '0010', # 2 + '0011', # 3 + '0100', # 4 + '0101', # 5 + '0110', # 6 + '0111', # 7 + '1000', # 8 + '1001', # 9 + '1010', # a + '1011', # b + '1100', # c + '1101', # d + '1110', # e + '1111'); # f $o = ''; $b = ''; $i = 0; @@ -329,7 +329,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip) /* file informations */ $md5 = md5_file ($file['tmp_name']); - $name = trim ($file['name']); + $name = str_replace (NL, '', trim ($file['name'])); $mime_type = $file['type']; $size = $file['size']; @@ -801,9 +801,10 @@ jirafeau_async_init ($filename, $type, $one_time, $key, $time, $ip) $p .= $ref; $handle = fopen ($p, 'w'); fwrite ($handle, - $filename . NL. $type . NL. $password . NL. $time . NL . - ($one_time ? 'O' : 'R') . NL . $ip . NL . date ('U') . NL . - $code . NL); + str_replace (NL, '', trim ($filename)) . NL . + str_replace (NL, '', trim ($type)) . NL . $password . NL . + $time . NL . ($one_time ? 'O' : 'R') . NL . $ip . NL . + date ('U') . NL . $code . NL); fclose ($handle); return $ref . NL . $code ; @@ -919,4 +920,4 @@ jirafeau_async_end ($ref, $code) jirafeau_async_delete ($ref); return $md5_link . NL . $delete_link_code; } -?> \ No newline at end of file +?>