Fredrick Brennan 7 years ago
parent
commit
8e811cec44
  1. 1
      inc/config.php
  2. 7
      post.php

1
inc/config.php

@ -1135,6 +1135,7 @@
$config['error']['toomanyreports'] = _('You can\'t report that many posts at once.');
$config['error']['invalidpassword'] = _('Wrong password…');
$config['error']['invalidimg'] = _('Invalid image.');
$config['error']['phpfileserror'] = _('Upload failure (file #%index%): Error code %code%. Refer to <a href="http://php.net/manual/en/features.file-upload.errors.php">http://php.net/manual/en/features.file-upload.errors.php</a>; post discarded.');
$config['error']['unknownext'] = _('Unknown file extension.');
$config['error']['filesize'] = _('Maximum file size: %maxsz% bytes<br>Your file\'s size: %filesz% bytes');
$config['error']['maxsize'] = _('The file was too big.');

7
post.php

@ -655,6 +655,13 @@ if (isset($_POST['delete'])) {
if ($post['has_file']) {
$i = 0;
foreach ($_FILES as $key => $file) {
if ($file['error'] > 0) {
error(sprintf3($config['error']['phpfileserror'], array(
'index' => $i+1,
'code' => $file['error']
)));
}
if ($file['size'] && $file['tmp_name']) {
$file['filename'] = urldecode($file['name']);
$file['extension'] = strtolower(mb_substr($file['filename'], mb_strrpos($file['filename'], '.') + 1));

Loading…
Cancel
Save