Project

General

Profile

Backport #7961

1.9.3-p392 REXML::Text.unnomralize bug

Added by Anonymous over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:52895]

Description

Hello everyone,
there is a bug introduced with p392 in parsing special characters with
REXML.
Here is the sample code to reproduce the bug:

REXML::Text.unnormalize('&')

it produces following error:

NameError: uninitialized constant REXML::Text::Document
from
/home/ubuntu/.rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/rexml/text.rb:386:in
block in unnormalize'
from
/home/ubuntu/.rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/rexml/text.rb:384:in
gsub'
from
/home/ubuntu/.rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/rexml/text.rb:384:in
`unnormalize'
from (irb):6

the workaround is to require "rexml/document" manually, but since its being
referenced from REXML::Text it should be required there.

Thank you and best regards,
Robert

Associated revisions

Revision ea2e083a
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

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

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 39509
Added by kou (Kouhei Sutou) over 6 years ago

  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Revision 5c2169d4
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 39509,39511: [Backport #7961]

    * lib/rexml/document.rb: move entity_expansion_limit accessor to ...

    * lib/rexml/rexml.rb: ... here to make rexml/text independent from
      REXML::Document. It causes circular require.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
      deprecated.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
      deprecated.

    * lib/rexml/text.rb: add missing require "rexml/rexml" for
      REXML.entity_expansion_limit.
      Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

    * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
      REXML.entity_expansion_text_limit.

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

Revision bccd52dd
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 39509,39511: [Backport #7961]

    * lib/rexml/document.rb: move entity_expansion_limit accessor to ...

    * lib/rexml/rexml.rb: ... here to make rexml/text independent from
      REXML::Document. It causes circular require.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
      deprecated.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
      deprecated.

    * lib/rexml/text.rb: add missing require "rexml/rexml" for
      REXML.entity_expansion_limit.
      Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

    * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
      REXML.entity_expansion_text_limit.

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

Revision 39977
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 39509,39511: [Backport #7961]

* lib/rexml/document.rb: move entity_expansion_limit accessor to ...

* lib/rexml/rexml.rb: ... here to make rexml/text independent from
  REXML::Document. It causes circular require.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
  deprecated.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
  deprecated.

* lib/rexml/text.rb: add missing require "rexml/rexml" for
  REXML.entity_expansion_limit.
  Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

* lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
  REXML.entity_expansion_text_limit.

Revision eca9bf61
Added by shyouhei (Shyouhei Urabe) over 6 years ago

merge revision(s) 39384,39509,39511: [Backport #7961]

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
      new attribute to read/write entity expansion text limit.  the default
      limit is 10Kb.

    * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.

    * lib/rexml/document.rb: move entity_expansion_limit accessor to ...

    * lib/rexml/rexml.rb: ... here to make rexml/text independent from
      REXML::Document. It causes circular require.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
      deprecated.

    * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
      deprecated.

    * lib/rexml/text.rb: add missing require "rexml/rexml" for
      REXML.entity_expansion_limit.
      Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

    * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

    * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
      REXML.entity_expansion_text_limit.

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

History

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Category set to lib
  • Status changed from Open to Assigned
  • Assignee set to kou (Kouhei Sutou)
  • Target version set to 2.1.0
  • ruby -v set to 1.9.3 p392

trunk, 2.0.0 and 1.9.3 all have same problem.

#2

Updated by kou (Kouhei Sutou) over 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39509.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  • lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated.
  • lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated.
  • lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

Updated by kou (Kouhei Sutou) over 6 years ago

Here are related commits: r39509, r39510, r39511 and r39528.

#4

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Category deleted (lib)
  • Status changed from Closed to Assigned
  • Assignee changed from kou (Kouhei Sutou) to nagachika (Tomoyuki Chikanaga)
  • Target version deleted (2.1.0)

I'm planning to backport only r39509 to ruby_1_9_3.
How about ruby_2_0_0, chikanaga-san?

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

I want to merge r39509 and r39511 to ruby_2_0_0.

#6

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39952.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39509,39511: [Backport #7961]

* lib/rexml/document.rb: move entity_expansion_limit accessor to ...

* lib/rexml/rexml.rb: ... here to make rexml/text independent from
  REXML::Document. It causes circular require.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
  deprecated.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
  deprecated.

* lib/rexml/text.rb: add missing require "rexml/rexml" for
  REXML.entity_expansion_limit.
  Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

* lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
  REXML.entity_expansion_text_limit.
#7

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned
  • Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)
#8

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39977.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39509,39511: [Backport #7961]

* lib/rexml/document.rb: move entity_expansion_limit accessor to ...

* lib/rexml/rexml.rb: ... here to make rexml/text independent from
  REXML::Document. It causes circular require.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
  deprecated.

* lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
  deprecated.

* lib/rexml/text.rb: add missing require "rexml/rexml" for
  REXML.entity_expansion_limit.
  Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

* lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
  REXML.entity_expansion_text_limit.

Also available in: Atom PDF