2
# key.rb: Comment-key filter Ver.0.5.0
3
# included TDiary::Filter::KeyFilter class
6
# * This filter must use together plugin 'comment_key.rb'.
9
# http://www20.big.or.jp/~rin_ne/soft/tdiary/commentkey.htm
11
# Copyright (c) 2005 Hahahaha <rin_ne@big.or.jp>
12
# Distributed under the GPL
17
class KeyFilter < Filter
18
def comment_filter( diary, comment )
19
return true unless @conf['comment_key.enable']
20
return true if /^(TrackBack|Pingback)$/ =~ comment.name
23
keyprefix = @conf['comment_key.prefix'] || 'tdiary'
24
vkey = Digest::MD5.hexdigest(keyprefix + (@conf['comment_key.nodate'] == 'true' ? "" : @cgi.params['date'][0]))
25
vkey == @cgi.params['comment_key'][0]