Check to not overwrite upload if file_exists.
This commit is contained in:
parent
91705fdb1f
commit
7af6e32304
|
@ -454,10 +454,15 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis =
|
||||||
if ($do_attach) {
|
if ($do_attach) {
|
||||||
move_uploaded_file($_FILES["photo"]["tmp_name"], $attachment_temp_dir . $_FILES["photo"]["name"]);
|
move_uploaded_file($_FILES["photo"]["tmp_name"], $attachment_temp_dir . $_FILES["photo"]["name"]);
|
||||||
if ($authname != null) {
|
if ($authname != null) {
|
||||||
if (! is_dir($spooldir . '/upload/' . $authname)) {
|
$uploadname = $authname;
|
||||||
mkdir($spooldir . '/upload/' . $authname);
|
} else {
|
||||||
}
|
$uploadname = $CONFIG['anonusername'];
|
||||||
copy($attachment_temp_dir . $_FILES["photo"]["name"], $spooldir . '/upload/' . $authname . '/' . $_FILES["photo"]["name"]);
|
}
|
||||||
|
if (! is_dir($spooldir . '/upload/' . $uploadname)) {
|
||||||
|
mkdir($spooldir . '/upload/' . $uploadname);
|
||||||
|
}
|
||||||
|
if (! file_exists($spooldir . '/upload/' . $uploadname . '/' . $_FILES["photo"]["name"])) {
|
||||||
|
copy($attachment_temp_dir . $_FILES["photo"]["name"], $spooldir . '/upload/' . $uploadname . '/' . $_FILES["photo"]["name"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ns = nntp_open($server, $port);
|
$ns = nntp_open($server, $port);
|
||||||
|
|
Loading…
Reference in New Issue