diff options
| author | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-12 15:48:46 +0000 |
|---|---|---|
| committer | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-12 15:48:46 +0000 |
| commit | e8b79efa2ef8e65cb9c95d9ae1aea37c744c2f0f (patch) | |
| tree | 4c038773ade30d694a4b01d2747d38536422272b | |
| parent | ac9b10ebb99bcd77b16c9c40653894e582d964e9 (diff) | |
| download | ruby-e8b79efa2ef8e65cb9c95d9ae1aea37c744c2f0f.tar.gz ruby-e8b79efa2ef8e65cb9c95d9ae1aea37c744c2f0f.tar.xz ruby-e8b79efa2ef8e65cb9c95d9ae1aea37c744c2f0f.zip | |
* lib/cgi/util.rb (CGI::pretty): fix the overflow bug
if stripped string.[ruby-dev:37975]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/cgi/util.rb | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Nov 13 00:46:24 2009 Takeyuki FUJIOKA <xibbar@ruby-lang.org> + + * lib/cgi/util.rb (CGI::pretty): fix the overflow bug + if stripped string.[ruby-dev:37975] + Thu Nov 12 23:08:11 2009 Takeyuki FUJIOKA <xibbar@ruby-lang.org> * lib/cgi/core.rb (read_from_cmdline): this code is better. diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index fbba00b96..42f1336e9 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -170,7 +170,7 @@ class CGI # # </HTML> # def CGI::pretty(string, shift = " ") - lines = string.gsub(/(?!\A)<(?:.|\n)*?>/, "\n\\0").gsub(/<(?:.|\n)*?>(?!\n)/, "\\0\n") + lines = string.gsub(/(?!\A)<.*?>/m, "\n\\0").gsub(/<.*?>(?!\n)/m, "\\0\n") end_pos = 0 while end_pos = lines.index(/^<\/(\w+)/, end_pos) element = $1.dup |
