- 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
# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patshaping@gmx.net>
# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-09-05
+# Last modified: 2004-10-04
$content = encode_entities($content,"\200-\377");
}
$content = encode_entities($content,"\200-\377");
}
- if($data->{'cgi'}->param('saveas'))
+ if($data->{'cgi'}->param('saveas') && $data->{'new_physical'} ne '' && $data->{'new_virtual'} ne '')
{
# Create the new filename
{
# Create the new filename
}
return error($config->{'errors'}->{'editdir'},upper_path($virtual)) if(-d $physical);
}
return error($config->{'errors'}->{'editdir'},upper_path($virtual)) if(-d $physical);
- return error($config->{'errors'}->{'noedit'}, upper_path($virtual)) unless(-r $physical && -w $physical);
+ return error($config->{'errors'}->{'noedit'}, upper_path($virtual)) if(-e $physical && !(-r $physical && -w $physical));
if(file_save($physical,\$content))
{
if(file_save($physical,\$content))
{