use warnings;
use Exporter;
-use Packages::Config;
our @ISA = qw( Exporter );
our @EXPORT = qw( DEBUG debug fatal_error get_mime );
return $mime_types{$_[0]} || $_[1] || 'text/html';
}
-our (@fatal_errors, @errors, @debug, @msgs, @hints, @notes);
+our (@fatal_errors, @errors, @debug, @hints);
our $http_code;
sub reset {
- @fatal_errors = @errors = @debug = @msgs = @hints = @notes = ();
+ @fatal_errors = @errors = @debug = @hints = ();
$http_code = 200;
}
my $lvl = $_[1] || 0;
push(@debug, $_[0]) if $debug > $lvl;
}
-sub msg {
- push @msgs, $_[0];
-}
-sub note {
- push @notes, [ @_ ];
-}
sub get_errors { (@fatal_errors, @errors) }
sub get_debug {
return unless $debug && @debug;
return @debug;
}
-sub get_msgs { @msgs };
sub get_hints { @hints };
-sub get_notes { @notes };
sub get_all_messages {
return {
errors => [ @fatal_errors, @errors ],
debugs => $debug ? \@debug : [],
- msgs => \@msgs,
hints => \@hints,
- notes => \@notes,
};
}
foreach my $param ( keys %params ) {
- debug( "Param <strong>$param</strong>", 2 ) if DEBUG;
+ debug( "Param $param", 2 ) if DEBUG;
my $p_value_orig = $cgi->param($param);
sub string2id {
my $string = "@_";
-
- $string =~ s/[^\w]/_/g;
+
+ $string =~ s/[^\w:.-]/_/g;
return $string;
}