summaryrefslogtreecommitdiff
path: root/test/cgi/test_cgi_util.rb
AgeCommit message (Collapse)Author
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-08-04change call CGI methods from :: to .Semyon Pupkov
Closes: https://github.com/ruby/ruby/pull/1749
2018-05-03Revert "ext/cgi/escape: preserve String subclass in result"normal
This reverts commit 6afea14043b0c0e603f26c89ae0d043f65852668 r63328 I misread the original bug report and got results flipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02ext/cgi/escape: preserve String subclass in resultnormal
* ext/cgi/escape/escape.c (optimized_escape_html): use rb_str_new_with_class (optimized_unescape_html): ditto (optimized_escape): ditto (optimized_unescape): ditto * test/cgi/test_cgi_util.rb (test_escape_string_subclass): new test [ruby-core:86847] [Bug #14732] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-18Fix strange indentationk0kubun
which I introduced at r58773. Hard tabs and spaces are mixed... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17cgi/util.rb: Don't escape tilde in #escapek0kubun
to make it compatible with ERB::Util.url_encode. ext/cgi/escape/escape.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-06share `@@accept_charset`nobu
* 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
2017-02-18{lib,test}/cgi: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-02escape.c: check argumentnobu
* ext/cgi/escape/escape.c (optimized_unescape): check accept_charset encoding argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-02test_cgi_util.rb: encoding testsnobu
* test/cgi/test_cgi_util.rb (test_cgi_unescape): \u is useless on old versions. * test/cgi/test_cgi_util.rb (test_cgi_include_unescape): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-20cgi/util.rb: remove CGI::Util#_unescapenobu
* ext/cgi/escape/escape.c (cgiesc_unescape): define unescape method instead of _unescape, and should pass the optional argument to the super method. * lib/cgi/util.rb (CGI::Util#_unescape): remove intermediate method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-14test_cgi_util.rb: test_cgi_unescapeHTML_invalidnobu
* test/cgi/test_cgi_util.rb (test_cgi_unescapeHTML_invalid): test for invalid escaped HTML, borrowed from rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06ASCII-incompatible escapenobu
* lib/cgi/util.rb (escapeHTML, unescapeHTML): consider ASCII-incompatible encodings. [Fix GH-1239] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22escape.c: should not freezenobu
* ext/cgi/escape/escape.c (optimized_escape_html): CGI.escapeHTML should return unfrozen new string. [ruby-core:72426] [Bug #11858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-21escape.c: Preserve original statenobu
* ext/cgi/escape/escape.c (preserve_original_state): Preserve original state for tainted and frozen. [Fix GH-1166] [ruby-dev:49451] [Bug #11855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-20cgi/escape: Optimize CGI.escapeHTMLnobu
* cgi/escape/escape.c: Optimize CGI.escapeHTML for ASCII-compatible encodings. [Fix GH-1164] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-20test_cgi_util.rb: fix arguments ordersnobu
* test/cgi/test_cgi_util.rb: fix arguments orders, expected values should be placed first and then actual results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12fix env leaksnobu
* lib/rubygems/test_case.rb (setup, teardown): fix environment variable change leaks. * test/cgi/update_env.rb: ditto. * test/rake/test_rake_application_options.rb (setup, teardown): ditto. * test/rake/test_rake_file_utils.rb (setup, teardown): ditto. * test/rubygems/test_gem_request.rb (setup): add https_proxy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-21cgi/util.rb: use aliasnobu
* lib/cgi/util.rb (escape_html, unescape_html): make synonyms aliases instead of wrapper methods. * lib/cgi/util.rb (escape_element, unescape_element): ditto. [Fixes GH-573] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-21test_cgi_util.rb: escape for ruby-mode.elnobu
* test/cgi/test_cgi_util.rb (CGIUtilTest): escape '<' not ruby-mode.el to confuse with here documents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-03* lib/cgi/util.rb: class methods modulize for using like a function.xibbar
[Feature #8354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08* lib/cgi/util.rb (CGI::unescapeHTML): fix Hexadecimal numeric character.xibbar
[Bug #8183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21* lib/cgi/util.rb (CGI.escapeHTML): use &#39;naruse
[ruby-core:47221] [Bug #6861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-14Tue Aug 14 11:55:37 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar
* lib/cgi/util.rb (CGI::escapeHTML): &apos; is not recommended. [Bug #6850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17Wed Jul 18 07:59:29 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar
* lib/cgi/util.rb (CGI.escapeHTML,unescapeHTML): Add &apos; for HTML5 escaping. [Feature #6620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-04Wed Jul 4 13:38:12 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar
* lib/cgi/util.rb: revert 36299: &apos; is XML specification. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03Wed Jul 4 08:24:28 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar
* lib/cgi/util.rb: Add &apos; to CGI's HTML escaping.[Feature #6620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-23* test/cgi/test_cgi_util.rb (test_cgi_escape_preserve_encoding):mrkn
add a test for CGI::escape to preserve encoding. * test/cgi/test_cgi_util.rb (test_cgi_unescape_preserve_encoding): add a test for CGI::unescape to preserve encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-20* lib/cgi/util.rb (CGI.escape): support a string with invalid bytemrkn
sequence. * test/cgi/test_cgi_util.rb (test_cgi_escape_with_invalid_byte_sequence): test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* lib/cgi/util.rb (CGI::unescape): bugfix to unescape the multibytexibbar
string. Thanks nobu and tDiary dev members. [Bug #3909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-23* test/cgi: check by Encoding.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30add a test.xibbar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30* lib/cgi/util.rb (CGI::unescape): support encoding option.xibbar
* lib/cgi/cookie.rb (CGI::Cookie.parse): fix for the encoded value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e