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
commit8579eb578d99e56d0510cef600baf0de439388a0 (patch)
treed57f14b3589af2e4fce1c342b2c957cad1501657
parentf9d8e92a0be24a72b8bffedfaca050ec6b346c95 (diff)
downloadpttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar.gz
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar.bz2
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar.lz
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar.xz
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.tar.zst
pttbbs-8579eb578d99e56d0510cef600baf0de439388a0.zip
correct 'blog.pl/xxx' to 'blog.pl/xxx/'
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@920 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xpttbbs/blog/blog.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/pttbbs/blog/blog.pl b/pttbbs/blog/blog.pl
index 86469046..e0100d4e 100755
--- a/pttbbs/blog/blog.pl
+++ b/pttbbs/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;
}