<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,7 +18,13 @@ require 'rexml/entity'
 module REXML
   class Entity &lt; Child
     def unnormalized
-      document.record_entity_expansion!
+      # Due to an optimisation in REXML, the default entities aren't
+      # associated with a document.  As these enties are defined and
+      # not recursive, we know that expanding them won't cause any
+      # issues.  Other entities in the document will still have
+      # the association to the document preventing this from opening
+      # a new attack vector.
+      document.record_entity_expansion! if document
       v = value()
       return nil if v.nil?
       @unnormalized = Text::unnormalize(v, parent)</diff>
      <filename>lib/rexml-expansion-fix.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name     = &quot;rexml-expansion-fix&quot;
-  s.version  = &quot;1.0.0&quot;
-  s.date     = &quot;2008-08-22&quot;
+  s.version  = &quot;1.0.1&quot;
+  s.date     = &quot;2008-08-31&quot;
   s.summary  = &quot;Prevents potentitial DoS attacks to rexml&quot;
   s.email    = &quot;michael@koziarski.com&quot;
   s.homepage = &quot;http://github.com/NZKoz/rexml-expansion-fix&quot;</diff>
      <filename>rexml-expansion-fix.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>90668758853c543aa5bef57e6405bcb0aaf6be07</id>
    </parent>
  </parents>
  <author>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </author>
  <url>http://github.com/NZKoz/rexml-expansion-fix/commit/784f16ba7de56e243330b846050222fb6d0d44e0</url>
  <id>784f16ba7de56e243330b846050222fb6d0d44e0</id>
  <committed-date>2008-08-31T09:41:33-07:00</committed-date>
  <authored-date>2008-08-31T09:41:33-07:00</authored-date>
  <message>Handle a bug which prevented parsing in some circumstances.

If your document had a custom doc-type and your body contained &amp;lt; &amp;gt; &amp;quot; or &amp;apos; the previous
version would cause a NoMethodError.  This is caused by an optimisation in REXML which means those
entities don't have an association to their Document.</message>
  <tree>dca71953c4cfa33b39080611fc55060eda6fbf63</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
