mirror of
https://gitlab.com/mojo42/Jirafeau.git
synced 2025-04-22 12:36:17 +02:00
remove clear text password storage
This commit is contained in:
parent
8dc8b4bc88
commit
ab330a749d
2
file.php
2
file.php
@ -102,7 +102,7 @@ if(isset($_GET['h']) && !empty($_GET['h'])) {
|
||||
require(JIRAFEAU_ROOT . 'lib/template/footer.php');
|
||||
exit;
|
||||
} else {
|
||||
if($key != $_POST['key']) {
|
||||
if($key != md5($_POST['key'])) {
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
|
||||
require(JIRAFEAU_ROOT . 'lib/template/header.php');
|
||||
|
@ -173,10 +173,15 @@ function jirafeau_upload($file, $one_time_download, $key, $time, $cfg, $ip) {
|
||||
for ($i = 0; $i < 8; $i++)
|
||||
$delete_link_code .= dechex(rand(0,16));
|
||||
|
||||
/* md5 password or empty */
|
||||
$password = '';
|
||||
if (!empty($key))
|
||||
$password = md5($key);
|
||||
|
||||
/* create link file */
|
||||
$link_tmp_name = VAR_LINKS . $md5 . rand(0, 10000) . '.tmp';
|
||||
$handle = fopen($link_tmp_name, 'w');
|
||||
fwrite($handle, $name . NL . $mime_type . NL . $size . NL . $key . NL . $time . NL . $md5 . NL . ($one_time_download ? 'O' : 'R') . NL . date('U') . NL . $ip . NL . $delete_link_code . NL);
|
||||
fwrite($handle, $name . NL . $mime_type . NL . $size . NL . $password . NL . $time . NL . $md5 . NL . ($one_time_download ? 'O' : 'R') . NL . date('U') . NL . $ip . NL . $delete_link_code . NL);
|
||||
fclose($handle);
|
||||
$md5_link = md5_file($link_tmp_name);
|
||||
if(!rename($link_tmp_name, VAR_LINKS . $md5_link)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user