diff --git a/.gitignore b/.gitignore index ac24f28..4aa99ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ cache attachments +*.sh +*.patch diff --git a/Sources/UploadAttachment.php b/Sources/UploadAttachment.php index 244dbcd..93b4c32 100644 --- a/Sources/UploadAttachment.php +++ b/Sources/UploadAttachment.php @@ -23,9 +23,7 @@ if (!defined('SMF')) function UploadAttachment() { - global $txt, $scripturl, $topic, $modSettings, $board; - global $user_info, $sc, $board_info, $context, $settings; - global $sourcedir, $options, $smcFunc, $language; + global $modSettings, $user_info, $sourcedir; if (!allowedTo('post_attachment') && !allowedTo('post_unapproved_attachments')){ die(json_encode(array( @@ -67,44 +65,6 @@ function UploadAttachment() 'ok' => false, 'error' => $attachmentOptions['errors'][0] ))); - - /* consider mapping errors to readable strings - if (in_array('could_not_upload', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_lang_error('attach_timeout', 'critical'); - } - if (in_array('too_large', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_lang_error('file_too_big', false, array($modSettings['attachmentSizeLimit'])); - } - if (in_array('bad_extension', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_error($attachmentOptions['name'] . '.
' . $txt['cant_upload_type'] . ' ' . $modSettings['attachmentExtensions'] . '.', false); - } - if (in_array('directory_full', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_lang_error('ran_out_of_space', 'critical'); - } - if (in_array('bad_filename', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_error(basename($attachmentOptions['name']) . '.
' . $txt['restricted_filename'] . '.', 'critical'); - } - if (in_array('taken_filename', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_lang_error('filename_exists'); - } - if (in_array('bad_attachment', $attachmentOptions['errors'])) - { - checkSubmitOnce('free'); - fatal_lang_error('bad_attachment'); - } - */ } } }