# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patrick@patshaping.de>
-# Last modified: 2005-06-09
+# Last modified: 2005-06-14
#
use strict;
$tpl->fillin('FILE_URL',escape($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
$tpl->fillin('MD5SUM',$md5sum);
$tpl->fillin('CONTENT',encode_html($$content));
local *FILE;
- sysopen(FILE,$physical,O_RDWR | O_CREAT) or return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => $virtual});
- file_lock(*FILE,LOCK_EX) or do { close(FILE); return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => $virtual}) };
+ sysopen(FILE,$physical,O_RDWR | O_CREAT) or return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => encode_html($virtual)});
+ file_lock(*FILE,LOCK_EX) or do { close(FILE); return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => encode_html($virtual)}) };
my $md5 = new Digest::MD5;
$md5->addfile(*FILE);
$tpl->fillin('FILE_URL',escape($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
$tpl->fillin('MD5SUM',$md5file);
$tpl->fillin('CONTENT',encode_html($content));
$tpl->fillin('DIR',encode_html($virtual));
$tpl->fillin('DIR_URL',escape($virtual));
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
$tpl->fillin('DIR_URL',escape($dir));
$tpl->fillin('COMMAND','copy');
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
$tpl->fillin('FILE',encode_html($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},encode_html($virtual)));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
if($new_physical)
{
- my $new_virtual = $data->{'new_virtual'};
- my $new_dir = upper_path($new_virtual);
- $new_virtual = encode_html($new_virtual);
+ my $new_virtual = multi_string($data->{'new_virtual'});
+ my $new_dir = upper_path($new_virtual->{'normal'});
if(-e $new_physical)
{
my $tpl = new Template;
$tpl->read_file($config->{'templates'}->{'confirm_replace'});
- $tpl->fillin('FILE',$virtual);
- $tpl->fillin('NEW_FILE',$new_virtual);
- $tpl->fillin('NEW_FILENAME',file_name($new_virtual));
- $tpl->fillin('NEW_DIR',$new_dir);
- $tpl->fillin('DIR',$dir);
+ $tpl->fillin('FILE',encode_html($virtual));
+ $tpl->fillin('NEW_FILE',$new_virtual->{'html'});
+ $tpl->fillin('NEW_FILENAME',file_name($new_virtual->{'html'}));
+ $tpl->fillin('NEW_DIR',encode_html($new_dir));
+ $tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('COMMAND','rename');
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
}
}
- move($physical,$new_physical) or return error($config->{'errors'}->{'rename_failed'},$dir,{FILE => $virtual, NEW_FILE => $new_virtual});
+ move($physical,$new_physical) or return error($config->{'errors'}->{'rename_failed'},$dir,{FILE => encode_html($virtual), NEW_FILE => $new_virtual->{'html'}});
return devedit_reload({command => 'show', file => $new_dir});
}
else
my $tpl = new Template;
$tpl->read_file($config->{'templates'}->{'renamefile'});
- $tpl->fillin('FILE',$virtual);
+ $tpl->fillin('FILE',encode_html($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
$tpl->fillin('DIR_URL',escape($virtual));
$tpl->fillin('UPPER_DIR',encode_html($dir));
$tpl->fillin('UPPER_DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},encode_html($virtual)));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
$tpl->fillin('FILE_URL',escape($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},encode_html($virtual)));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');
$tpl->fillin('FILE_URL',escape($virtual));
$tpl->fillin('DIR',encode_html($dir));
$tpl->fillin('DIR_URL',escape($dir));
- $tpl->fillin('URL',equal_url($config->{'httproot'},encode_html($virtual)));
+ $tpl->fillin('URL',encode_html(equal_url($config->{'httproot'},$virtual)));
$tpl->fillin('SCRIPT',$script);
my $output = header(-type => 'text/html');