フォーチュンサモナーズ
«前の日記(2005-06-18) 最新 次の日記(2005-07-01)» 編集

Don'tStopMusic

2003|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|12|
2006|01|02|03|04|05|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|08|09|10|

カテゴリ別 2003年 | 2004年 | 2005年 | 2006年 | 2007年 | 2008年

知り合いサイト: よんだもの / 暴想 / Linuxでやる夫 / 新宿Vipper / 僕だけが幸せになればいいのに。


2005-06-22

_ [サイト運営] SPAM 避けチェックボックス入れました このエントリーを含むブックマーク

少し前になりますが、大量のツッコミスパムが来ましたので、あおきさんの tDiary / コメント SPAM 避けチェックボックスパッチを適用しました。

2.0.1 ですと index.rb にそのままパッチを当てても動作しませんので、手抜き修正をしています。手抜きじゃない修正をしている方がいましたら教えて下さい……


--- tdiary-2.0.1/index.rb       2004-03-15 00:03:59.000000000 +0900
+++ /var/www/localhost/htdocs/diary/index.rb    2005-06-15 19:56:26.000000000 +0900
@@ -28,7 +28,12 @@
 
        begin
                if @cgi.valid?( 'comment' ) then
-                       tdiary = TDiary::TDiaryComment::new( @cgi, "day.rhtml", conf )
+#                      tdiary = TDiary::TDiaryComment::new( @cgi, "day.rhtml", conf )
+                       if @cgi.valid?('ishuman') and @cgi.params['ishuman']
+                               tdiary = TDiary::TDiaryComment::new( @cgi, "day.rhtml", conf )
+                       else
+                               raise TDiary::ForceRedirect.new('spamwarn.html')
+                       end
                elsif @cgi.valid?( 'date' )
                        date = @cgi.params['date'][0]
                        if /^\d{8}$/ =~ date then
@@ -98,6 +103,20 @@
                        <body>Wait or <a href="#{$!.path}">Click here!</a></body>
                        </html>]
        end
+rescue TDiary::ForceRedirect
+       head = {
+               #'Location' => $!.path
+               'type' => 'text/html',
+       }
+       print @cgi.header( head )
+       print %Q[
+               <html>
+               <head>
+               <meta http-equiv="refresh" content="1;url=#{$!.path}">
+               <title>moving...</title>
+               </head>
+               <body>Wait or <a href="#{$!.path}">Click here!</a></body>
+               </html>]
 rescue Exception
        if @cgi then
                print @cgi.header( 'type' => 'text/plain' )
本日のTrackBacks(全1件) []
_ 小鳥ピヨピヨ(a cheeping little bird):僕が惚れ込んだPC88ゲームたち(ゲームバトン) (2005-06-27 16:28)

すみません。今日はちょっと長いです。 ミズタマのチチさんから、ゲームバトンがやってきました。


最近のコメント:

RSS
Creative Commons License
This work is licensed under a Creative Commons License
(note: text only. w/o web design, citations, (re)distributed softwares).