From 6a4499d441793336945f8dd7aa4485ee0fafc1ee Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Sun, 2 Jan 2005 13:33:28 +0000 Subject: [PATCH] - 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 --- errors.dat | 3 ++- modules/Command.pm | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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); -- 2.34.1