]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #3919 merged file upload failure check to master
authorcash <cash.costello@gmail.com>
Tue, 11 Oct 2011 00:15:09 +0000 (20:15 -0400)
committercash <cash.costello@gmail.com>
Tue, 11 Oct 2011 00:15:09 +0000 (20:15 -0400)
mod/file/actions/file/upload.php
mod/file/languages/en.php

index ee2889b4c212a07265b5a092dca402aebb1057f3..3edc87952a10da7cadf9cb283198622ba4dcbeca 100644 (file)
@@ -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);
index aa30084a92f610ca684183ad2becbaf012a5c998..96fbd1c485181b3e7989a5643e241b37ec0e4399 100644 (file)
@@ -100,7 +100,7 @@ $english = array(
                'file:downloadfailed' => "Sorry; this file is not available at this time.",
                'file:deletefailed' => "Your file could not be deleted at this time.",
                'file:noaccess' => "You do not have permissions to change this file",
-               'file:cannotload' => "There was an error loading the file",
+               'file:cannotload' => "There was an error uploading the file",
                'file:nofile' => "You must select a file",
 );