[Pyukiwiki-cvs 0007525] CVS update: PyukiWiki-Devel/lib

Back to archive index

PyukiWiki CVS Commit pyuki****@lists*****
2012年 3月 1日 (木) 15:20:00 JST


Index: PyukiWiki-Devel/lib/.htaccess
diff -u PyukiWiki-Devel/lib/.htaccess:1.461 PyukiWiki-Devel/lib/.htaccess:1.462
--- PyukiWiki-Devel/lib/.htaccess:1.461	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/.htaccess	Thu Mar  1 15:19:59 2012
@@ -1,7 +1,7 @@
 ######################################################################
 # Apache lib/.htaccess for PyukiWiki
-# $Id: .htaccess,v 1.461 2012/02/27 23:03:34 papu Exp $
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# $Id: .htaccess,v 1.462 2012/03/01 06:19:59 papu Exp $
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 ######################################################################
 
 Order allow,deny
Index: PyukiWiki-Devel/lib/aguse.inc.pl
diff -u PyukiWiki-Devel/lib/aguse.inc.pl:1.330 PyukiWiki-Devel/lib/aguse.inc.pl:1.331
--- PyukiWiki-Devel/lib/aguse.inc.pl:1.330	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/aguse.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # aguse.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: aguse.inc.pl,v 1.330 2012/02/27 23:03:34 papu Exp $
+# $Id: aguse.inc.pl,v 1.331 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/antispam.inc.pl
diff -u PyukiWiki-Devel/lib/antispam.inc.pl:1.472 PyukiWiki-Devel/lib/antispam.inc.pl:1.473
--- PyukiWiki-Devel/lib/antispam.inc.pl:1.472	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/antispam.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # antispam.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: antispam.inc.pl,v 1.472 2012/02/27 23:03:34 papu Exp $
+# $Id: antispam.inc.pl,v 1.473 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/antispamwiki.inc.pl
diff -u PyukiWiki-Devel/lib/antispamwiki.inc.pl:1.425 PyukiWiki-Devel/lib/antispamwiki.inc.pl:1.426
--- PyukiWiki-Devel/lib/antispamwiki.inc.pl:1.425	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/antispamwiki.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # antispamwiki.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: antispamwiki.inc.pl,v 1.425 2012/02/27 23:03:34 papu Exp $
+# $Id: antispamwiki.inc.pl,v 1.426 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/authadmin_cookie.inc.pl
diff -u PyukiWiki-Devel/lib/authadmin_cookie.inc.pl:1.469 PyukiWiki-Devel/lib/authadmin_cookie.inc.pl:1.470
--- PyukiWiki-Devel/lib/authadmin_cookie.inc.pl:1.469	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/authadmin_cookie.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # authadmin_cookie.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: authadmin_cookie.inc.pl,v 1.469 2012/02/27 23:03:34 papu Exp $
+# $Id: authadmin_cookie.inc.pl,v 1.470 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/autometarobot.inc.pl
diff -u PyukiWiki-Devel/lib/autometarobot.inc.pl:1.461 PyukiWiki-Devel/lib/autometarobot.inc.pl:1.462
--- PyukiWiki-Devel/lib/autometarobot.inc.pl:1.461	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/autometarobot.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # autometarobot.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: autometarobot.inc.pl,v 1.461 2012/02/27 23:03:34 papu Exp $
+# $Id: autometarobot.inc.pl,v 1.462 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/debug.inc.js
diff -u PyukiWiki-Devel/lib/debug.inc.js:1.330 PyukiWiki-Devel/lib/debug.inc.js:1.331
--- PyukiWiki-Devel/lib/debug.inc.js:1.330	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/debug.inc.js	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 /*/////////////////////////////////////////////////////////////////////
 # debug.inc.js - This is PyukiWiki, yet another Wiki clone.
-# $Id: debug.inc.js,v 1.330 2012/02/27 23:03:34 papu Exp $
+# $Id: debug.inc.js,v 1.331 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/debug.inc.pl
diff -u PyukiWiki-Devel/lib/debug.inc.pl:1.471 PyukiWiki-Devel/lib/debug.inc.pl:1.472
--- PyukiWiki-Devel/lib/debug.inc.pl:1.471	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/debug.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # debug.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: debug.inc.pl,v 1.471 2012/02/27 23:03:34 papu Exp $
+# $Id: debug.inc.pl,v 1.472 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/google_analytics.inc.pl
diff -u PyukiWiki-Devel/lib/google_analytics.inc.pl:1.316 PyukiWiki-Devel/lib/google_analytics.inc.pl:1.317
--- PyukiWiki-Devel/lib/google_analytics.inc.pl:1.316	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/google_analytics.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # google_analytics.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: google_analytics.inc.pl,v 1.316 2012/02/27 23:03:34 papu Exp $
+# $Id: google_analytics.inc.pl,v 1.317 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/google_translate.inc.pl
diff -u PyukiWiki-Devel/lib/google_translate.inc.pl:1.86 PyukiWiki-Devel/lib/google_translate.inc.pl:1.87
--- PyukiWiki-Devel/lib/google_translate.inc.pl:1.86	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/google_translate.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # google_translate.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: google_translate.inc.pl,v 1.86 2012/02/27 23:03:34 papu Exp $
+# $Id: google_translate.inc.pl,v 1.87 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/iecompatiblehack.inc.pl
diff -u PyukiWiki-Devel/lib/iecompatiblehack.inc.pl:1.392 PyukiWiki-Devel/lib/iecompatiblehack.inc.pl:1.393
--- PyukiWiki-Devel/lib/iecompatiblehack.inc.pl:1.392	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/iecompatiblehack.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # iecompatiblehack.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: iecompatiblehack.inc.pl,v 1.392 2012/02/27 23:03:34 papu Exp $
+# $Id: iecompatiblehack.inc.pl,v 1.393 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/lang.inc.pl
diff -u PyukiWiki-Devel/lib/lang.inc.pl:1.442 PyukiWiki-Devel/lib/lang.inc.pl:1.443
--- PyukiWiki-Devel/lib/lang.inc.pl:1.442	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/lang.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # lang.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: lang.inc.pl,v 1.442 2012/02/27 23:03:34 papu Exp $
+# $Id: lang.inc.pl,v 1.443 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/linktrack.inc.js
diff -u PyukiWiki-Devel/lib/linktrack.inc.js:1.332 PyukiWiki-Devel/lib/linktrack.inc.js:1.333
--- PyukiWiki-Devel/lib/linktrack.inc.js:1.332	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/linktrack.inc.js	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 /*/////////////////////////////////////////////////////////////////////
 # linktrack.inc.js - This is PyukiWiki, yet another Wiki clone.
-# $Id: linktrack.inc.js,v 1.332 2012/02/27 23:03:34 papu Exp $
+# $Id: linktrack.inc.js,v 1.333 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/linktrack.inc.pl
diff -u PyukiWiki-Devel/lib/linktrack.inc.pl:1.344 PyukiWiki-Devel/lib/linktrack.inc.pl:1.345
--- PyukiWiki-Devel/lib/linktrack.inc.pl:1.344	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/linktrack.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # linktrack.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: linktrack.inc.pl,v 1.344 2012/02/27 23:03:34 papu Exp $
+# $Id: linktrack.inc.pl,v 1.345 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/logs.inc.pl
diff -u PyukiWiki-Devel/lib/logs.inc.pl:1.180 PyukiWiki-Devel/lib/logs.inc.pl:1.181
--- PyukiWiki-Devel/lib/logs.inc.pl:1.180	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/logs.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # logs.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: logs.inc.pl,v 1.180 2012/02/27 23:03:34 papu Exp $
+# $Id: logs.inc.pl,v 1.181 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/pathmenu.inc.pl
diff -u PyukiWiki-Devel/lib/pathmenu.inc.pl:1.24 PyukiWiki-Devel/lib/pathmenu.inc.pl:1.25
--- PyukiWiki-Devel/lib/pathmenu.inc.pl:1.24	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/pathmenu.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # pathmenu.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: pathmenu.inc.pl,v 1.24 2012/02/27 23:03:34 papu Exp $
+# $Id: pathmenu.inc.pl,v 1.25 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/punyurl.inc.pl
diff -u PyukiWiki-Devel/lib/punyurl.inc.pl:1.462 PyukiWiki-Devel/lib/punyurl.inc.pl:1.463
--- PyukiWiki-Devel/lib/punyurl.inc.pl:1.462	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/punyurl.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # punyurl.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: punyurl.inc.pl,v 1.462 2012/02/27 23:03:34 papu Exp $
+# $Id: punyurl.inc.pl,v 1.463 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/setting.inc.pl
diff -u PyukiWiki-Devel/lib/setting.inc.pl:1.443 PyukiWiki-Devel/lib/setting.inc.pl:1.444
--- PyukiWiki-Devel/lib/setting.inc.pl:1.443	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/setting.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # setting.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: setting.inc.pl,v 1.443 2012/02/27 23:03:34 papu Exp $
+# $Id: setting.inc.pl,v 1.444 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/slashpage.inc.pl
diff -u PyukiWiki-Devel/lib/slashpage.inc.pl:1.467 PyukiWiki-Devel/lib/slashpage.inc.pl:1.468
--- PyukiWiki-Devel/lib/slashpage.inc.pl:1.467	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/slashpage.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # slashpage.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: slashpage.inc.pl,v 1.467 2012/02/27 23:03:34 papu Exp $
+# $Id: slashpage.inc.pl,v 1.468 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
Index: PyukiWiki-Devel/lib/urlhack.inc.pl
diff -u PyukiWiki-Devel/lib/urlhack.inc.pl:1.482 PyukiWiki-Devel/lib/urlhack.inc.pl:1.483
--- PyukiWiki-Devel/lib/urlhack.inc.pl:1.482	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/urlhack.inc.pl	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # urlhack.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: urlhack.inc.pl,v 1.482 2012/02/27 23:03:34 papu Exp $
+# $Id: urlhack.inc.pl,v 1.483 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
@@ -29,10 +29,10 @@
 	if(!defined($urlhack::use_path_info));
 #
 # fake extension 拡張子偽装
-$urlhack::fake_extention="/"		# only "/"
+$urlhack::fake_extention="/"		# use path_info, only "/"
 	if(!defined($urlhack::fake_extention));
 #
-# use puny url 0:16進エンコード 1:punyエンコード 2:UTF8エンコード
+# use puny url 0:16進エンコード 1:punyエンコード 2:UTF8エンコード 3:短縮URL
 $urlhack::use_puny=1
 	if(!defined($urlhack::use_puny));
 #
@@ -43,15 +43,55 @@
 # force url hack (non extention .cgi)
 $urlhack::force_exec=0			# PATH_INFOを使わない場合で、拡張子CGIでない場合、1を設定
 	if(!defined($urlhack::force_exec));
+
+# 短縮URLのDB(言語考慮不要)
+$urlhack::shortdb="./wikidb"
+	if(!defined($urlhack::shortdb));
+
+###################
+# sample of puny
+## PATH_INFO を使う(0の場合File not foundを補足する)
+#$urlhack::use_path_info=0
+#	if(!defined($urlhack::use_path_info));
+##
+## fake extension 拡張子偽装
+#$urlhack::fake_extention=""		# use path_info, only "/"
+#	if(!defined($urlhack::fake_extention));
+##
+## use puny url 0:16進エンコード 1:punyエンコード 2:UTF8エンコード 3:短縮URL
+#$urlhack::use_puny=3
+#	if(!defined($urlhack::use_puny));
+##
+## not convert Alphabet or Number ( or dot and slash) page
+#$urlhack::noconvert_marks=0	# 0:NO / 1:Alpha&Number / 2:AlphaNumber and mark
+#	if(!defined($urlhack::noconvert_marks));
+##
+## force url hack (non extention .cgi)
+#$urlhack::force_exec=1			# PATH_INFOを使わない場合で、拡張子CGIでない場合、1を設定
+#	if(!defined($urlhack::force_exec));
+#
+## 短縮URLのDB(言語考慮不要)
+#$urlhack::shortdb="./wikidb"
+#	if(!defined($urlhack::shortdb));
+
 #
 ######################################################################
 
 use strict;
+use Nana::MD5;
+my %urldb;
 
 # Initlize														# comment
 
 sub plugin_urlhack_init {
 	&exec_explugin_sub("lang");
+
+	if($urlhack::use_puny eq 3) {
+		my $err=&writechk($urlhack::shortdb);
+		&print_error($err)  if($err ne '');
+		&dbopen($urlhack::shortdb,\%urldb);
+	}
+
 	unless($::form{mypage} eq '' || $::form{mypage} eq $::FrontPage) {
 		return('init'=>0
 			,'func'=>'make_cookedurl',
@@ -83,10 +123,12 @@
 		$req=~s/$regex$//g;
 	}
 	# アルファベット数字のみで、変換不要の場合 FrontPage 等		# comment
-	if(&is_exist_page($req)) {
-		$::form{cmd}='read';
-		$::form{mypage}=$req;
-		return 0;
+	if($urlhack::use_puny ne 3) {
+		if(&is_exist_page($req)) {
+			$::form{cmd}='read';
+			$::form{mypage}=$req;
+			return 0;
+		}
 	}
 
 	# 前後の不要なスラッシュを削除								# comment
@@ -100,10 +142,12 @@
 		$req=~s/$regex$//g;
 	}
 	# アルファベット数字のみで、変換不要の場合 FrontPage 等		# comment
-	if(&is_exist_page($req)) {
-		$::form{cmd}='read';
-		$::form{mypage}=$req;
-		return 0;
+	if($urlhack::use_puny ne 3) {
+		if(&is_exist_page($req)) {
+			$::form{cmd}='read';
+			$::form{mypage}=$req;
+			return 0;
+		}
 	}
 	$req=&plugin_urlhack_decode($req);
 	# URIが空の時の処理											# comment
@@ -203,11 +247,13 @@
 		$req=~s/$regex$//g;
 	}
 	# アルファベット数字のみで、変換不要の場合 FrontPage 等		# comment
-	$req=~s/%([A-Fa-f0-9][A-Fa-f0-9])/chr(hex($1))/eg;
-	if(&is_exist_page($req)) {
-		$::form{cmd}='read';
-		$::form{mypage}=$req;
-		return 0;
+	if($urlhack::use_puny ne 3) {
+		$req=~s/%([A-Fa-f0-9][A-Fa-f0-9])/chr(hex($1))/eg;
+		if(&is_exist_page($req)) {
+			$::form{cmd}='read';
+			$::form{mypage}=$req;
+			return 0;
+		}
 	}
 	$req=&plugin_urlhack_decode($req);
 
@@ -235,11 +281,11 @@
 		return 1;
 	# でなければ、404 Not foundで返す							# comment
 	} else {
-		$::form{cmd}='servererror';
-		$ENV{REDIRECT_STATUS}=404;
-		$ENV{REDIRECT_URL}=$ENV{REQUEST_URI};
-		$ENV{REDIRECT_REQUEST_METHOD}="GET";
-		return 0;
+#		$::form{cmd}='servererror';
+#		$ENV{REDIRECT_STATUS}=404;
+#		$ENV{REDIRECT_URL}=$ENV{REQUEST_URI};
+#		$ENV{REDIRECT_REQUEST_METHOD}="GET";
+#		return 0;
 	}
 }
 
@@ -283,6 +329,14 @@
 <link rel="canonical" href="$::basehref@{[&plugin_urlhack_encode($str,$urlhack::use_puny)]}" />
 EOM
 		}
+	} elsif(&urldb_decode($str) ne '') {
+		$str=&urldb_decode($str);
+		if($urlhack::use_puny ne 3) {
+			&getbasehref;
+			$::IN_HEAD.=<<EOM;
+<link rel="canonical" href="$::basehref@{[&plugin_urlhack_encode($str,$urlhack::use_puny)]}" />
+EOM
+		}
 	} elsif($str=~/^[0-9A-Fa-f]+/) {
 		$str=~s/([A-Fa-f0-9][A-Fa-f0-9])/pack("C", hex($1))/eg;
 		if($urlhack::use_puny ne 0) {
@@ -316,6 +370,8 @@
 #		$str=~s!%20!+!g;	# comment
 		$str=~s!%2d!-!g;
 		$str=~s!%2[Ff]!/!g;
+	} elsif($enc eq 3) {
+		$str=&urldb_encode($str);
 	} else {
 		&plugin_urlhack_usepuny;
 		$str=~s/\+/!2b/g;
@@ -332,6 +388,57 @@
 	return $str;
 }
 
+sub urldb_decode {
+	my($str)=shift;
+	&dbopen($urlhack::shortdb,\%urldb);
+	my $str=$urldb{"p$::lang" . $str};
+	return $str;
+}
+
+sub urldb_encode {
+	my($str)=shift;
+	my $try=62;
+	my $chk=$urldb{"c$::lang" . $str};
+	if($chk ne '') {
+		return $chk;
+	}
+	my $count=$urldb{"sys-count"}+0;
+	my $keylen;
+	my $tmp=1;
+	for(my $i=1; $i<=30; $i++) {
+		$keylen=$i;
+		$tmp=$tmp * $try;
+			last if($count < $tmp);
+	}
+	my $c=0;
+	my $hashedurl;
+	my $cmpedurl;
+	do {
+		$hashedurl=Nana::MD5::md5($c . time . $c . $str);
+		$c++;
+		$cmpedurl=substr(&trip($hashedurl),0, $keylen);
+		if($urldb{"p$::lang" . $cmpedurl} eq '') {
+			$urldb{"c$::lang" . $str}=$cmpedurl;
+			$urldb{"p$::lang" . $cmpedurl}=$str;
+			$urldb{"sys-count"}=($count+1);
+			$str=$cmpedurl;
+			return $str;
+		}
+	} while($c<1000);
+	return $str;
+}
+
+sub trip {
+	my ($tripkey)=shift;
+	$tripkey = substr($tripkey,1);
+	my $salt = substr($tripkey.'H.',1,2);
+	$salt =~ s/[^\.-z]/\./go;
+	$salt =~ tr/:;<=>?@[\\]^_`/ABCDEFGabcdef/;
+	my $trip = crypt($tripkey,$salt);
+	$trip =~ tr/\/:;<=>?@[\\]^_`./ABCDEFGHabcdefgh/;
+	return $trip;
+}
+
 sub plugin_urlhack_usepuny {
 	if($::puny_loaded+0 ne 1) {
 		if($] < 5.008001) {
Index: PyukiWiki-Devel/lib/wiki.cgi
diff -u PyukiWiki-Devel/lib/wiki.cgi:1.692 PyukiWiki-Devel/lib/wiki.cgi:1.693
--- PyukiWiki-Devel/lib/wiki.cgi:1.692	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/wiki.cgi	Thu Mar  1 15:19:59 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # wiki.cgi - This is PyukiWiki, yet another Wiki clone.
-# $Id: wiki.cgi,v 1.692 2012/02/27 23:03:34 papu Exp $
+# $Id: wiki.cgi,v 1.693 2012/03/01 06:19:59 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/
 # Copyright (C) 2005-2012 PyukiWiki Developers Team
@@ -33,7 +33,7 @@
 
 ##############################									# comment
 $::package = 'PyukiWiki';
-$::version = '0.2.0-p2-preview5';
+$::version = '0.2.0-p2-preview6';
 
 # 2005.12.19 pochi: mod_perlで実行可能に			# comment
 # グローバル関数の定義								# comment
Index: PyukiWiki-Devel/lib/xframe.inc.pl
diff -u PyukiWiki-Devel/lib/xframe.inc.pl:1.68 PyukiWiki-Devel/lib/xframe.inc.pl:1.69
--- PyukiWiki-Devel/lib/xframe.inc.pl:1.68	Tue Feb 28 08:03:34 2012
+++ PyukiWiki-Devel/lib/xframe.inc.pl	Thu Mar  1 15:20:00 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # xframe.inc.pl - This is PyukiWiki, yet another Wiki clone.
-# $Id: xframe.inc.pl,v 1.68 2012/02/27 23:03:34 papu Exp $
+# $Id: xframe.inc.pl,v 1.69 2012/03/01 06:20:00 papu Exp $
 #
-# "PyukiWiki" version 0.2.0-p2-preview5 $$
+# "PyukiWiki" version 0.2.0-p2-preview6 $$
 # Author: Nanami http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
 # http://nekyo.qp.land.to/



Pyukiwiki-cvs メーリングリストの案内
Back to archive index