[Slashdotjp-dev 616] CVS update: slashjp/themes/slashcode/htdocs

アーカイブの一覧に戻る

Tatsuki SUGIURA sugi****@users*****
2006年 9月 7日 (木) 19:17:04 JST


Index: slashjp/themes/slashcode/htdocs/article.pl
diff -u slashjp/themes/slashcode/htdocs/article.pl:1.5 slashjp/themes/slashcode/htdocs/article.pl:1.6
--- slashjp/themes/slashcode/htdocs/article.pl:1.5	Thu Sep  7 18:55:06 2006
+++ slashjp/themes/slashcode/htdocs/article.pl	Thu Sep  7 19:17:04 2006
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: article.pl,v 1.5 2006/09/07 09:55:06 sugi Exp $
+# $Id: article.pl,v 1.6 2006/09/07 10:17:04 sugi Exp $
 
 use strict;
 use Slash;
@@ -36,10 +36,14 @@
 		if ($story->{primaryskid} != $cur_skid) {
 			my $cur_skin = $reader->getSkin($cur_skid);
 			my $story_skin = $reader->getSkin($story->{primaryskid});
-			if (0 && $story_skin && $story_skin->{rootdir} # TODO: fix in future...
-				&& $story_skin->{rootdir} ne $cur_skin->{rootdir}) {
-				redirect("$story_skin->{rootdir}$ENV{REQUEST_URI}");
-				return;
+			if ($story_skin && $story_skin->{rootdir}
+				&& $story_skin->{rootdir} ne $cur_skin->{rootdir}){
+				my ($cur_pathbase) = $ENV{REQUEST_URI} =~ m|/([^/]+)|;
+				my ($story_pathbase) = "$story_skin->{rootdir}$ENV{REQUEST_URI}" =~ m|//[^/]+/([^/]+)|;
+				if ($cur_pathbase ne $story_pathbase){
+					redirect("$story_skin->{rootdir}$ENV{REQUEST_URI}");
+					return;
+				}
 			}
 		}
 	}


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る