Skip to content

Commit b6f5833

Browse files
committed
Check existence constants only URI module
1 parent eafc475 commit b6f5833

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/uri/common.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def self.parser=(parser = RFC3986_PARSER)
3434
end
3535

3636
Parser.new.regexp.each_pair do |sym, str|
37-
remove_const(sym) if const_defined?(sym)
37+
remove_const(sym) if const_defined?(sym, false)
3838
const_set(sym, str)
3939
end
4040
end

lib/uri/rfc2396_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def convert_to_uri(uri)
539539

540540
# Backward compatibility for URI::REGEXP::PATTERN::*
541541
RFC2396_Parser.new.pattern.each_pair do |sym, str|
542-
unless RFC2396_REGEXP::PATTERN.const_defined?(sym)
542+
unless RFC2396_REGEXP::PATTERN.const_defined?(sym, false)
543543
RFC2396_REGEXP::PATTERN.const_set(sym, str)
544544
end
545545
end

0 commit comments

Comments
 (0)