index be20928c029972fadff8285804865d9ae0b13b82..e28e98572238e04e6e1e9ea52a6a8d565e88b1e2 100755 (executable)
use lib ('../lib');
use utf8;
+use Carp (qw(cluck confess));
use FindBin ('$RealBin');
use CGI (':cgi');
use CGI::Carp ('fatalsToBrowser');
<title>collection.cgi, Version 3</title>
<link rel="icon" href="../share/shortcut-icon.png" type="image/png" />
<link rel="stylesheet" href="../share/style.css" type="text/css" />
- <script type="text/javascript" src="../share/navigate.js" />
+ <script type="text/javascript" src="../share/navigate.js"></script>
</head>
<body onload="nav_init ($begin, $end);">
HTML
HTML
}
+sub contains_invalid_chars
+{
+ my $str = shift;
+
+ for (split (m//, $str))
+ {
+ my $n = ord ($_);
+
+ # Whitespace is allowed.
+ if (($n >= 9) && ($n <= 13))
+ {
+ next;
+ }
+ elsif ($n < 32)
+ {
+ return (1);
+ }
+ }
+
+ return;
+}
+
sub show_selector
{
my $timespan_selection = get_timespan_selection ();
HTML
for (sort (keys %$host_selection))
{
+ next if contains_invalid_chars ($_);
my $host = encode_entities ($_);
my $selected = $host_selection->{$_}
? ' selected="selected"'
HTML
for (sort (keys %$plugin_selection))
{
+ next if contains_invalid_chars ($_);
my $plugin = encode_entities ($_);
my $selected = $plugin_selection->{$_}
? ' selected="selected"'
HTML
for (sort { $TimeSpans->{$a} <=> $TimeSpans->{$b} } (keys (%$TimeSpans)))
{
+ next if contains_invalid_chars ($_);
my $name = encode_entities ($_);
my $value = $TimeSpans->{$_};
my $selected = ($value == $timespan_selection)
for (sort @hosts)
{
my $url = encode_entities (script_name () . "?action=show_selection;hostname=$_");
+ next if contains_invalid_chars ($_);
my $name = encode_entities ($_);
print qq# <li><a href="$url">$name</a></li>\n#;
}
my $file = $_;
my $type = ucfirst (lc ($file->{'type'}));
- $type =~ s/[^A-Za-z_]//g;
- $type =~ s/_([A-Za-z])/\U$1\E/g;
+ $type =~ s/[^A-Za-z0-9_]//g;
+ $type =~ s/_([A-Za-z0-9])/\U$1\E/g;
if (!defined ($types->{$type}))
{