[#40961] [Bug #3137] complex.rb changes exceptions of Math — Yusuke Endoh <redmine@...>

Bug #3137: complex.rb changes exceptions of Math

15 messages 2010/04/12
[#40967] Re: [Bug #3137] complex.rb changes exceptions of Math — keiju@... (石塚圭樹) 2010/04/13

けいじゅ@いしつかです.

[#41038] Windows と DL が使用条件の libffi — Aaron Patterson <aaron.patterson@...>

こんにちは!アーロンです。

17 messages 2010/04/22
[#41039] Re: Windows と DL が使用条件の libffi — "U.Nakamura" <usa@...> 2010/04/22

こんにちは、なかむら(う)です。

[#41040] Re: Windows と DL が使用条件の libffi — "NARUSE, Yui" <naruse@...> 2010/04/22

成瀬です。

[#41059] Re: Windows と DL が使用条件の libffi — Aaron Patterson <aaron.patterson@...> 2010/04/26

2010/4/21 NARUSE, Yui <naruse@airemix.jp>:

[#41060] Re: Windows と DL が使用条件の libffi — Yugui <yugui@...> 2010/04/26

2010/4/26 Aaron Patterson <aaron.patterson@gmail.com>:

[#41067] [Feature #3203] LazySweepGC patch — Narihiro Nakamura <redmine@...>

Feature #3203: LazySweepGC patch

15 messages 2010/04/26
[#41069] Re: [Feature #3203] LazySweepGC patch — Yusuke ENDOH <mame@...> 2010/04/27

遠藤です。

[#41104] Rails3 M17N — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

29 messages 2010/04/30
[#41111] Re: Rails3 M17N — Urabe Shyouhei <shyouhei@...> 2010/04/30

Yukihiro Matsumoto =E3=81=95=E3=82=93=E3=81=AF=E6=9B=B8=E3=81=8D=E3=81=BE=

[#41113] Re: Rails3 M17N — Yukihiro Matsumoto <matz@...> 2010/04/30

まつもと ゆきひろです

[ruby-dev:40950] Re: URI.decode_www_form("?a=b")

From: "NARUSE, Yui" <naruse@...>
Date: 2010-04-10 22:11:51 UTC
List: ruby-dev #40950
(2010/04/09 18:29), Tanaka Akira wrote:
> URI.decode_www_form は、引数の先頭にある ? を無視します。
> 
> % ./ruby -ruri -ve 'p URI.decode_www_form("?a=b")'
> ruby 1.9.2dev (2010-04-08 trunk 27262) [i686-linux]
> [["a", "b"]]
> % ./ruby -ruri -ve 'p URI.decode_www_form("a=b")'
> ruby 1.9.2dev (2010-04-08 trunk 27262) [i686-linux]
> [["a", "b"]]
> 
> 意図は分かるんですが、残念なことに、URI の query には ? という文字を
> 入れられます。
> 
> RFC 3986:
> 
>        query       = *( pchar / "/" / "?" )
> 
> そのため、? で始まる key もちゃんと扱うにはどうするのか明瞭ではありません。
> ここは ? の特別扱いをあきらめたほうがいいんじゃないでしょうか。

どこかで form data の POST 時に ? を含めてしまう実装があるとか見たような
記憶があるんですが、見つからないので、そうしましょうか。

> あと、その
> 
>      unless /\A\??(?<query>[^=;&]*=[^;&]*(?:[;&][^=;&]*=[^;&]*)*)\z/ =~ str
> 
> というところで、[^;&]* というパターンが使われていて、
> 正しい application/x-www-form-urlencoded であることを検査していません。
> ちゃんと検査したほうがいい気がするんですがどうでしょうか。
> 
> % ./ruby -ruri -e 'p URI.decode_www_form("%=%")'
> [["%", "%"]]

「正しい application/x-www-form-urlencoded」がどの程度の範囲までなのかが
ちょっとよくわからないのですが、こんな感じですかねぇ。

  WFKV_ = '(?:%\h\h|[^%#=;&]+)' # :nodoc:
  def self.decode_www_form(str, enc=Encoding::UTF_8)
    return [] if str.empty?
    unless /\A#{WFKV_}*=#{WFKV_}*(?:[;&]#{WFKV_}*=#{WFKV_}*)*\z/o =~ str

-- 
NARUSE, Yui  <naruse@airemix.jp>

In This Thread

Prev Next