fix a related bug
This commit is contained in:
parent
bd6e5da096
commit
f4422e597b
6
post.php
6
post.php
@ -546,6 +546,7 @@ if (isset($_POST['delete'])) {
|
|||||||
|
|
||||||
|
|
||||||
if ($post['has_file']) {
|
if ($post['has_file']) {
|
||||||
|
$fnarray = array();
|
||||||
foreach ($post['files'] as $key => &$file) {
|
foreach ($post['files'] as $key => &$file) {
|
||||||
if (!in_array($file['extension'], $config['allowed_ext']) && !in_array($file['extension'], $config['allowed_ext_files']))
|
if (!in_array($file['extension'], $config['allowed_ext']) && !in_array($file['extension'], $config['allowed_ext_files']))
|
||||||
error($config['error']['unknownext']);
|
error($config['error']['unknownext']);
|
||||||
@ -560,6 +561,9 @@ if (isset($_POST['delete'])) {
|
|||||||
} else {
|
} else {
|
||||||
$filenames .= (' ' . escapeshellarg($file['tmp_name']));
|
$filenames .= (' ' . escapeshellarg($file['tmp_name']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fnarray[] = $file['tmp_name'];
|
||||||
|
|
||||||
$upload = $file['tmp_name'];
|
$upload = $file['tmp_name'];
|
||||||
|
|
||||||
if (!is_readable($upload))
|
if (!is_readable($upload))
|
||||||
@ -576,7 +580,7 @@ if (isset($_POST['delete'])) {
|
|||||||
$post['filehash'] = md5_file($upload);
|
$post['filehash'] = md5_file($upload);
|
||||||
} else {
|
} else {
|
||||||
$str_to_hash = '';
|
$str_to_hash = '';
|
||||||
foreach (explode(' ', $filenames) as $i => $f) {
|
foreach ($fnarray as $i => $f) {
|
||||||
$str_to_hash .= file_get_contents($f);
|
$str_to_hash .= file_get_contents($f);
|
||||||
}
|
}
|
||||||
$post['filehash'] = md5($str_to_hash);
|
$post['filehash'] = md5($str_to_hash);
|
||||||
|
Loading…
Reference in New Issue
Block a user