Project

General

Profile

Actions

Bug #1787

closed

URI ライブラリの正規表現パターン

Added by drry (drry  ) almost 13 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.1p243 (2009-07-16 revision 24174) [x86_64-linux]
Backport:

Description

=begin
Ruby 1.9 の正規表現で \d の意味が変わっているので、全角数字が URI として通ってしまいます。URI が BINARY のみを対象にしているのであれば、この限りではありません。

irb(main):001:0> require "uri"
=> true
irb(main):002:0> URI("tag:example.jp:/紅玉")
URI::InvalidURIError: bad URI(is not URI?): tag:example.jp:/紅玉
from uri/common.rb:156:in split' from uri/common.rb:174:in parse'
from uri/common.rb:626:in parse' from uri/common.rb:724:in URI'
from (irb):2
from bin/irb:12:in `'
irb(main):003:0> URI("tag:example.jp:/1")
=> #<URI::Generic:0x00000001673888 URL:tag:example.jp:/1>

Expected: => URI::InvalidURIError

irb(main):004:0> URI.escape("紅玉1.9")
=> "%E7%B4%85%E7%8E%89\xEF\xBC\x91%EF%BC%8E\xEF\xBC\x99"

Expected: => "%E7%B4%85%E7%8E%89%EF%BC%91%EF%BC%8E%EF%BC%99"

=end


Files

lib_uri_common-u.patch (10.3 KB) lib_uri_common-u.patch drry (drry  ), 07/19/2009 12:34 AM
lib_uri_common-wu.patch (2.87 KB) lib_uri_common-wu.patch for review (ignore all white space) drry (drry  ), 07/19/2009 12:34 AM
lib_uri_common.patch (2.83 KB) lib_uri_common.patch drry (drry  ), 07/19/2009 01:24 AM
lib_uri_common-r2.patch (13.2 KB) lib_uri_common-r2.patch drry (drry  ), 07/19/2009 08:26 AM
lib_uri_common-r3.patch (6.26 KB) lib_uri_common-r3.patch for r25291 drry (drry  ), 10/11/2009 01:55 AM
lib_uri_common-r3-w.patch (692 Bytes) lib_uri_common-r3-w.patch ignore whole whitespace changes. drry (drry  ), 10/11/2009 01:55 AM
Actions

Also available in: Atom PDF