aboutsummaryrefslogtreecommitdiff
path: root/mod/file/actions/file/upload.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-10 20:15:09 -0400
committercash <cash.costello@gmail.com>2011-10-10 20:15:09 -0400
commit1e4c47b736718ecb18a4367657e147e412fab06e (patch)
tree0d3767c62cbf1117386c46b94bb992b3f5e097d4 /mod/file/actions/file/upload.php
parentf09ec105ae2b73e4a56b04ce87abc5c8d4254158 (diff)
downloadelgg-1e4c47b736718ecb18a4367657e147e412fab06e.tar.gz
elgg-1e4c47b736718ecb18a4367657e147e412fab06e.tar.bz2
Refs #3919 merged file upload failure check to master
Diffstat (limited to 'mod/file/actions/file/upload.php')
-rw-r--r--mod/file/actions/file/upload.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index ee2889b4c..3edc87952 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -19,6 +19,11 @@ if ($container_guid == 0) {
elgg_make_sticky_form('file');
+// check if upload failed
+if (!empty($_FILES['upload']['name']) && $_FILES['upload']['error'] != 0) {
+ register_error(elgg_echo('file:cannotload'));
+ forward(REFERER);
+}
// check whether this is a new file or an edit
$new_file = true;
@@ -29,7 +34,6 @@ if ($guid > 0) {
if ($new_file) {
// must have a file if a new file upload
if (empty($_FILES['upload']['name'])) {
-
$error = elgg_echo('file:nofile');
register_error($error);
forward(REFERER);