From: pcanterino <> Date: Sun, 2 Jan 2005 13:33:28 +0000 (+0000) Subject: - Check if the CGI module was able to create a valid handle for a file upload X-Git-Tag: version_2_3~9 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/6a4499d441793336945f8dd7aa4485ee0fafc1ee?ds=inline - Check if the CGI module was able to create a valid handle for a file upload - Changed the error message "lock_failed" a little bit --- diff --git a/errors.dat b/errors.dat index 10773ac..81e7b5e 100644 --- a/errors.dat +++ b/errors.dat @@ -21,7 +21,8 @@ file_in_use = The file '{FILE}' is currently edited by someone else. file_too_large = The file you want to view or edit is too large (max. {SIZE} Bytes). in_use = The file '{FILE}' is currently edited by someone else. invalid_group = '{GROUP}' seems to be an invalid group name. Please check it and try again. -lock_failed = Locking of '{USELIST}' failed. Try it again in a moment. If the problem persists, ask the administrator to create the lock file ('{LOCK_FILE}'). +invalid_upload = It seems that something is wrong with the file upload you want to submit. +lock_failed = Locking of '{USELIST}' failed. Try it again in a moment. If the problem persists, ask the administrator to check the lock file ('{LOCK_FILE}') and to recreate it if necessary. mkdir_failed = Could not create directory '{DIR}'. mkfile_failed = Could not create file '{FILE}'. no_copy = You have not enough permissions to copy this file. diff --git a/modules/Command.pm b/modules/Command.pm index 0b39533..96dbf52 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2004-12-28 +# Last modified: 2005-01-01 # use strict; @@ -500,6 +500,8 @@ sub exec_upload($$) my $ascii = $cgi->param('ascii'); my $handle = $cgi->upload('uploaded_file'); + return error($config->{'errors'}->{'invalid_upload'},$virtual) unless($handle); + # Read transferred file and write it to disk read($handle, my $data, -s $handle);