summaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi7
1 files changed, 5 insertions, 2 deletions
diff --git a/index.cgi b/index.cgi
index 6241434..e9e2c55 100755
--- a/index.cgi
+++ b/index.cgi
@@ -70,7 +70,7 @@ my $path = $cgi->path_info();
my $output = \&output_article;
my @args;
-if ( $path =~ /^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
+if ( $path =~ m/^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
@args = ( year => $1, month => $2, uri => $3 );
} elsif ( $path =~ m/^\/(\d{4})\/(\d{2})\/?$/ ) {
@args = ( year => $1, month => $2 );
@@ -84,6 +84,8 @@ if ( $path =~ /^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
$output = \&output_rss;
} elsif ( $path =~ m/^\/sitemap\.xml$/ ) {
$output = \&output_sitemap;
+} elsif ( $path ) {
+ @args = ( error => 1 );
}
$cgi->charset('UTF-8');
@@ -113,7 +115,8 @@ sub output_article {
$template->param( copyright => $blog_rights );
$template->param( google_analytics_id => $google_analytics_id );
$template->param( google_webmaster_id => $google_webmaster_id );
- if (@{$articles}) {
+
+ if (@{$articles} && !$args{'error'}) {
$template->param( articles => $articles );
if ($comments_allowed && $args{'uri'}) {
$template->param( comment_form => 1 );