add Include macro test and fix Include bug
This commit is contained in:
parent
e0b17be5dd
commit
b2d4c36080
3 changed files with 119 additions and 12 deletions
|
|
@ -40,19 +40,17 @@ sub process {
|
|||
my (@param, $temp, $file);
|
||||
@param = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_Include');
|
||||
if ($param[0] =~ /passwd/i || $param[0] =~ /shadow/i || $param[0] =~ m!WebGUI/\w+.conf!i) {
|
||||
$temp = $i18n->get('security');
|
||||
} else {
|
||||
$file = FileHandle->new($param[0],"r");
|
||||
if ($file) {
|
||||
while (<$file>) {
|
||||
$temp .= $_;
|
||||
}
|
||||
$file->close;
|
||||
} else {
|
||||
$temp = $i18n->get('not found');
|
||||
}
|
||||
if ($param[0] =~ /passwd/i || $param[0] =~ /shadow/i || $param[0] =~ m!WebGUI/etc/\w+\.conf!i) {
|
||||
return $i18n->get('security');
|
||||
}
|
||||
$file = FileHandle->new($param[0],"r");
|
||||
if ($file) {
|
||||
local $/;
|
||||
$temp = $file->getline();
|
||||
$file->close;
|
||||
} else {
|
||||
$temp = $i18n->get('not found');
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue