our $Dev = $ENV{HTTP_HOST} =~ /\bdev\./;
}
-our $Request = decode_utf8($ENV{PATH_INFO} =~ s{^/}{}r);
+our $Request //= decode_utf8($ENV{PATH_INFO} =~ s{^/}{}r);
our $style;
-our $showkeys = !exists $get{keys} ? undef :
+our $showkeys //= !exists $get{keys} ? undef :
($get{keys} ne '0' && ($get{keys} || 'always'));
$header{content_type} = 'text/html; charset=utf-8';
return map { sprintf(
'<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
- $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.12", $_
+ $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.13", $_
) } @avail;
}
BEGIN {
$PLP::ERROR = sub {
- my ($text, $html) = @_;
- warn $text;
+ my ($message, $html) = @_;
+ if (ref $message) {
+ warn join ': ', @{$message};
+ $html = shift @{$message};
+ }
+ else {
+ warn $message;
+ $message = [];
+ }
unless ($PLP::sentheaders) {
Html({nocache => 1});
say '<h1>Page unavailable</h1>';
}
- Alert("<strong>Fatal error</strong>: $html.");
+ Alert("Fatal error: $html.", @{$message});
};
}