summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-10-24 13:43:15 +0200
committerczaks <marcin@6irc.net>2014-10-24 13:43:15 +0200
commitf4422e597b5c5a1f0c8b921bd7027cd8d3c04f83 (patch)
tree5bff63f0dbcf0f216ff060e87f77cfe6ba74a5fa
parentbd6e5da09624c0e7e6b21141f76ef9418fb700d9 (diff)
fix a related bug
-rw-r--r--post.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/post.php b/post.php
index 21929bfa..45fd021e 100644
--- a/post.php
+++ b/post.php
@@ -546,6 +546,7 @@ if (isset($_POST['delete'])) {
if ($post['has_file']) {
+ $fnarray = array();
foreach ($post['files'] as $key => &$file) {
if (!in_array($file['extension'], $config['allowed_ext']) && !in_array($file['extension'], $config['allowed_ext_files']))
error($config['error']['unknownext']);
@@ -560,6 +561,9 @@ if (isset($_POST['delete'])) {
} else {
$filenames .= (' ' . escapeshellarg($file['tmp_name']));
}
+
+ $fnarray[] = $file['tmp_name'];
+
$upload = $file['tmp_name'];
if (!is_readable($upload))
@@ -576,7 +580,7 @@ if (isset($_POST['delete'])) {
$post['filehash'] = md5_file($upload);
} else {
$str_to_hash = '';
- foreach (explode(' ', $filenames) as $i => $f) {
+ foreach ($fnarray as $i => $f) {
$str_to_hash .= file_get_contents($f);
}
$post['filehash'] = md5($str_to_hash);