From: Kazuhiko <kaz...@fd...> - 2010-10-04 21:52:53
|
On 03/10/2010 17:13, 牧野 尚彦 wrote: > いただいたパッチをあてたところ、 > 残念ながら下記の通り行番号以外変化しませんでした。 > ううむ…。 例外が起きているのが > incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) > > /usr/local/lib/ruby/1.9.1/cgi/util.rb:17:in `gsub' > /usr/local/lib/ruby/1.9.1/cgi/util.rb:17:in `unescape' > /home/pmakino/public_html/tdiary/tdiary.rb:262:in `add_referer' ←ここ なのですから、パッチをあてるべき箇所は --- core/tdiary.rb (revision 3603) +++ core/tdiary.rb (working copy) @@ -259,7 +259,11 @@ if /^([^:]+:\/\/)([^\/]+)/ =~ ref ref = $1 + $2.downcase + $' end - uref = CGI::unescape( ref ) + begin + uref = CGI::unescape( ref ) + rescue Encoding::CompatibilityError + return + end if pair = @referers[uref] then pair = [pair, ref] if pair.class != Array # for compatibility @referers[uref] = [pair[0] + count, pair[1]] ここじゃないでしょうか? # と思って、第二tDiary.Netのコードを見たら、すでにそういうパッチがあたっ ていたという。。。ごめんなさい。というわけで、これで動いています。 たださんがOKならコミットしてください。 かずひこ |