Bug 347105 - [p=reed r=timeless]

This commit is contained in:
reed%reedloden.com 2006-12-04 07:09:50 +00:00
Родитель 7a348ad3f8
Коммит d32a138cc9
2 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -770,7 +770,7 @@ sub FindPartition {
exit;
}
PrintHeader();
print h1("Searching for partitions matching $file ...");
print h1("Searching for partitions matching " . html_quote($file) . " ...");
foreach my $match (@matches) {
if (param("view")) {
# This should display modules just as they are displayed
@ -790,7 +790,7 @@ sub FindPartition {
}
else {
PrintHeader();
print h1("Searching for partitions matching $file ...");
print h1("Searching for partitions matching " . html_quote($file) . " ...");
print "No partitions found.";
}

Просмотреть файл

@ -58,5 +58,21 @@ sub name_to_id_token {
return $_;
}
1;
# Quotify a string, suitable for output as an html document
sub html_quote {
my ($var) = (@_);
$var =~ s/\&/\&/g;
$var =~ s/</\&lt;/g;
$var =~ s/>/\&gt;/g;
return $var;
}
# Quotify a string, suitable for invoking a shell process
sub shell_escape {
my ($file) = @_;
$file =~ s/\000/_NULL_/g;
$file =~ s/([ \"\'\`\~\^\?\$\&\|\!<>\(\)\[\]\;\:])/\\$1/g;
return $file;
}
1;