summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-02 10:09:38 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-02 10:09:38 +0800
commitcbb11c9b63c01bf5c06387a1459ce33490601367 (patch)
treebc3c8da1f7604a7660a7e9ff95a52aab089d8d46
parent07ecc9b6ab1c638bcaff65701f3a1b91d21b8fd2 (diff)
downloadpttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar.gz
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar.bz2
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar.lz
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar.xz
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.tar.zst
pttbbs-cbb11c9b63c01bf5c06387a1459ce33490601367.zip
correct 'blog.pl/xxx' to 'blog.pl/xxx/'
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@920 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xblog/blog.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/blog/blog.pl b/blog/blog.pl
index 86469046..e0100d4e 100755
--- a/blog/blog.pl
+++ b/blog/blog.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id: blog.pl,v 1.12 2003/06/01 09:19:25 in2 Exp $
+# $Id: blog.pl,v 1.13 2003/06/02 02:09:38 in2 Exp $
use CGI qw/:standard/;
use LocalVars;
use DB_File;
@@ -26,13 +26,15 @@ sub main
print header(-status => 400);
return;
}
- if( !(($brdname, $fn) = $ENV{PATH_INFO} =~ m|/([\w\-]+?)/([\.,\w]*)|) ||
+ if( !(($brdname, $fn) = $ENV{PATH_INFO} =~ m|^/([\w\-]+?)/([\.,\w]*)$|) ||
!( ($fn, $y, $m, $d) = parsefn($fn) ) ||
!(-e "$BLOGDATA/$brdname/$fn") ||
!(tie %config, 'DB_File',
"$BLOGDATA/$brdname/config.db", O_RDONLY, 0666, $DB_HASH) ||
!(tie %attr, 'DB_File',
"$BLOGDATA/$brdname/attr.db", O_RDONLY, 0666, $DB_HASH) ){
+ return redirect("http://blog.ptt2.cc/blog.pl/$1/")
+ if( $ENV{PATH_INFO} =~ m|^/([\w\-]+?)$| );
print header(-status => 404);
return;
}