Sha256: 1b9ef683eb512a71c3d3041084994f8ad9ac2fb93d21c3f5106c2576516a8c55

Contents?: true

Size: 806 Bytes

Versions: 52

Compression:

Stored size: 806 Bytes

Contents

#
# comment_key.rb: Comment-key filter  Ver.0.5.0
#  included TDiary::Filter::CommentKeyFilter class
#
# caution:
#   * This filter must use together plugin 'comment_key.rb'.
#
# see:
#   http://www20.big.or.jp/~rin_ne/soft/tdiary/commentkey.htm
#
# Copyright (c) 2005 Hahahaha <rin_ne@big.or.jp>
# Distributed under the GPL
#

module TDiary
	module Filter
		class CommentkeyFilter < Filter
			def comment_filter( diary, comment )
				return true unless @conf['comment_key.enable']
				return true if /^(?:TrackBack|Pingback)$/ =~ comment.name

				require 'digest/md5'
				keyprefix = @conf['comment_key.prefix'] || 'tdiary'
				vkey = Digest::MD5.hexdigest(keyprefix + (@conf['comment_key.nodate'] == 'true' ? "" : @cgi.params['date'][0]))
				vkey == @cgi.params['comment_key'][0]
			end
		end
	end
end

Version data entries

52 entries across 46 versions & 2 rubygems

Version Path
tdiary-contrib-5.0.10 filter/commentkey.rb
tdiary-contrib-5.0.9 filter/commentkey.rb
tdiary-contrib-5.0.8 filter/commentkey.rb
tdiary-contrib-5.0.7 filter/commentkey.rb
tdiary-contrib-5.0.6 filter/commentkey.rb
tdiary-contrib-5.0.5 filter/commentkey.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/filter/commentkey.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-fa9c20aa0d97/filter/commentkey.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-f08988dfa0f6/filter/commentkey.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-a3c5f37278c4/filter/commentkey.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/filter/commentkey.rb
tdiary-contrib-5.0.4 filter/commentkey.rb
tdiary-5.0.4 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/filter/commentkey.rb
tdiary-contrib-5.0.3 filter/commentkey.rb
tdiary-contrib-5.0.2 filter/commentkey.rb
tdiary-contrib-5.0.1 filter/commentkey.rb
tdiary-contrib-5.0.0 filter/commentkey.rb
tdiary-contrib-4.2.1 filter/commentkey.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/bundler/gems/tdiary-contrib-2ab36447ae2a/filter/commentkey.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/bundler/gems/tdiary-contrib-d189eb6688f1/filter/commentkey.rb