From: pcanterino <> Date: Mon, 4 Oct 2004 17:50:04 +0000 (+0000) Subject: Improved file editing using another filename: X-Git-Tag: version_2_1~6 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/4e40e9a450e412da79b7c3ef4a1eaae268b206a4?ds=sidebyside;hp=e03c585e9e4b96bd2934c57cf7c4ec030a13eaed Improved file editing using another filename: - If the user just entered spaces as filename (detection works for other commands using the "newfile" CGI parameter too), we use the original filename - Saving even works, if the file has to be created first --- diff --git a/devedit.pl b/devedit.pl index 13f71ee..cf4ea19 100644 --- a/devedit.pl +++ b/devedit.pl @@ -6,7 +6,7 @@ # Dev-Editor's main program # # Author: Patrick Canterino -# Last modified: 2004-07-04 +# Last modified: 2004-10-04 # use strict; @@ -50,7 +50,7 @@ my $newfile = $cgi->param('newfile') || ''; my $new_physical = ''; my $new_virtual = ''; -if($newfile ne '') +if($newfile ne '' && $newfile !~ /^\s+$/) { $curdir = upper_path($file) if($curdir eq ''); my $path = clean_path($curdir.$newfile);