Skip to content

Instantly share code, notes, and snippets.

@redsquirrel
Forked from topfunky/rexml_spec.rb
Created August 25, 2008 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redsquirrel/7129 to your computer and use it in GitHub Desktop.
Save redsquirrel/7129 to your computer and use it in GitHub Desktop.
##
# HACKER: Dave Hoover
#
# AUTHORS: Geoffrey Grosenbach http://nubyonrails.com
# Also http://p.ramaze.net/1887
#
# RUN:
# script/console
# paste the following and make sure an exception is thrown
dom = REXML::Document.new('<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE member [
<!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
<!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
<!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
<!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
<!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
<!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
<!ENTITY g "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
]>
<member>
&a;
</member>')
dom.root.elements.to_a('//member').first.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment