mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
merge revision(s) 27388:27390:
* lib/resolv.rb (Resolv::IPv4::Regex): make it only accept 0 to 255. [ruby-core:29501] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
36f1477f3f
commit
5859f1497e
4 changed files with 30 additions and 5 deletions
|
@ -2086,7 +2086,11 @@ class Resolv
|
|||
##
|
||||
# Regular expression IPv4 addresses must match.
|
||||
|
||||
Regex = /\A(\d+)\.(\d+)\.(\d+)\.(\d+)\z/
|
||||
Regex256 = /0
|
||||
|1(?:[0-9][0-9]?)?
|
||||
|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?
|
||||
|[3-9][0-9]?/x
|
||||
Regex = /\A(#{Regex256})\.(#{Regex256})\.(#{Regex256})\.(#{Regex256})\z/
|
||||
|
||||
def self.create(arg)
|
||||
case arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue