diff options
-rwxr-xr-x | blog/blog.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blog/blog.pl b/blog/blog.pl index d964e58e..db9c4c9d 100755 --- a/blog/blog.pl +++ b/blog/blog.pl @@ -29,6 +29,17 @@ sub main @cnumber = ('零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'); + if( $brdname = param('searchboard') ){ + dodbi(sub { + my($dbh) = @_; + my($sth); + $sth = $dbh->prepare("select k from counter where k='$brdname'"); + $sth->execute(); + $brdname = $sth->fetchrow_hashref()->{k}; + }); + return redirect("/blog.pl/$brdname/"); + } + if( !$ENV{PATH_INFO} ){ print header(-status => 400); return; |