diff options
| author | Randy Stauner <randy.stauner@shopify.com> | 2024-07-19 08:55:31 -0700 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-07-21 16:57:32 +0000 |
| commit | da49bee04b1ea664199c14318dbf594464974636 (patch) | |
| tree | 6f4d5a76f1f05a2c49d0acd07b2c3126fe076b8b /lib | |
| parent | c544f2672680d3c2992543bd91cdff6e7ce5ec51 (diff) | |
[ruby/uri] Restrict constant checks to current namespace to avoid conflicts with globals
https://github.com/ruby/uri/commit/7a64e0245f
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/uri/common.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 98cb18ec0d..a29a348c86 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -23,11 +23,11 @@ module URI Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor) def self.parser=(parser = RFC3986_PARSER) - remove_const(:Parser) if defined?(Parser) + remove_const(:Parser) if defined?(::URI::Parser) const_set("Parser", parser.class) - remove_const(:REGEXP) if defined?(REGEXP) - remove_const(:PATTERN) if defined?(PATTERN) + remove_const(:REGEXP) if defined?(::URI::REGEXP) + remove_const(:PATTERN) if defined?(::URI::PATTERN) if Parser == RFC2396_Parser const_set("REGEXP", URI::RFC2396_REGEXP) const_set("PATTERN", URI::RFC2396_REGEXP::PATTERN) |
