X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/1e1c9d8ed1f783a573036702f25e008fadd524b9..f9e51fc19507839a1347b41967520814cd05bcd8:/modules/Command.pm?ds=sidebyside diff --git a/modules/Command.pm b/modules/Command.pm index 0b39533..d6df6b2 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-05 # use strict; @@ -439,10 +439,10 @@ sub exec_mkdir($$) my $dir = upper_path($new_virtual); $new_virtual = encode_entities($new_virtual); - return error($config->{'errors'}->{'file_exists'},$dir,{FILE => $new_virtual}) if(-e $new_physical); - if($new_physical) { + return error($config->{'errors'}->{'file_exists'},$dir,{FILE => $new_virtual}) if(-e $new_physical); + mkdir($new_physical,0777) or return error($config->{'errors'}->{'mkdir_failed'},$dir,{DIR => $new_virtual}); return devedit_reload({command => 'show', file => $dir}); } @@ -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);