Project

General

Profile

Bug #13539

uninitialized class variable @@accept_charset in #<Class:CGI> when calling CGI.unescape

Added by janko (Janko Marohnić) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
[ruby-core:80986]

Description

When I execute this script:

require "cgi/util"
CGI.unescape("foo")

On Ruby 2.3.0 this will execute just fine, but on 2.4.1 this throws an error:

`unescape': uninitialized class variable @@accept_charset in #<Class:CGI> (NameError)

This doesn't happen when I require the whole cgi.rb standard library, only when I require cgi/util.rb. The reason why I want to require only cgi/util.rb is because I need only the URI escaping/unescaping behaviour.

Associated revisions

Revision 97849e11
Added by nobu (Nobuyoshi Nakada) over 2 years ago

share @@accept_charset

  • lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share @@accept_charset class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58576
Added by nobu (Nobuyoshi Nakada) over 2 years ago

share @@accept_charset

  • lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share @@accept_charset class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539]

Revision 58576
Added by nobu (Nobuyoshi Nakada) over 2 years ago

share @@accept_charset

  • lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share @@accept_charset class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539]

Revision 58576
Added by nobu (Nobuyoshi Nakada) over 2 years ago

share @@accept_charset

  • lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share @@accept_charset class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539]

Revision b2c7e974
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 57501,58576: [Backport #13539]

    escape.c: check argument

    * ext/cgi/escape/escape.c (optimized_unescape): check
      accept_charset encoding argument.
    share `@@accept_charset`

    * lib/cgi/{core,util}.rb: include CGI::Util not only extending, to
      share `@@accept_charset` class variable, so that it is always
      accessible.  [ruby-core:80986] [Bug #13539]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59511
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 57501,58576: [Backport #13539]

escape.c: check argument

* ext/cgi/escape/escape.c (optimized_unescape): check
  accept_charset encoding argument.
share `@@accept_charset`

* lib/cgi/{core,util}.rb: include CGI::Util not only extending, to
  share `@@accept_charset` class variable, so that it is always
  accessible.  [ruby-core:80986] [Bug #13539]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58576.


share @@accept_charset

  • lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share @@accept_charset class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539]
#2

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) over 2 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE

ruby_2_4 r59511 merged revision(s) 57501,58576.

Also available in: Atom PDF