summaryrefslogtreecommitdiff
path: root/lib/cgi
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-11-07Promote cgi to default gemsHiroshi SHIBATA
2019-08-19Prefer Regexp#=~ to Regexp#match when the RHS may be nilNobuyoshi Nakada
2019-08-09Fix typo: duplicated the [skip-ci]ohbarye
2019-08-04change call CGI methods from :: to .Semyon Pupkov
Closes: https://github.com/ruby/ruby/pull/1749
2018-12-04Use delete_prefix instead of `sub(/\Afixed-pattern/, '')`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03lib/cgi/util.rb: use requirenobu
* lib/cgi/util.rb: reverted r65505. require_relative does not work for cgi/escape.so, as extension libraries are placed in other directories than ruby libraries. [Bug #15206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02lib/*: Prefer require_relative over require.marcandre
[#15206] [Fix GH-1976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Use printf instead of puts and sprintfkazu
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02Fix cgi/core code example missing commakazu
ref https://github.com/rurema/doctree/pull/448 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59469 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
2016-11-21lib/*: remove closed checksnormal
Follow r56795. Since Ruby 2.2, calling #close on a closed socket no longer raises exceptions. * lib/cgi/session.rb (update): remove closed? check * lib/net/http.rb (finish, transport_request): ditto * lib/net/imap.rb (disconnect): ditto * lib/net/pop.rb (do_start, do_finish): ditto * lib/net/smtp.rb (do_start, do_finish): ditto * lib/open3.rb (popen_run, pipeline_run): ditto * lib/pstore.rb (transaction): ditto * lib/shell/process-controller.rb (sfork): * lib/tempfile (_close, call, Tempfile.create): ditto * lib/webrick/httpauth/htdigest.rb (flush): ditto * lib/webrick/httpauth/htpasswd.rb (flush): ditto * lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-27* lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]naruse
* lib/webrick/cookie.rb (parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28* lib/cgi/util.rb: added to missing quote.hsbt
[fix GH-1363][ci skip] Patch by @dwaller git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55185 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-21cgi/escape: Optimize CGI.unescapenobu
* cgi/escape/escape.c: Optimize CGI.unescape performance by C ext for ASCII-compatible encodings. [Fix GH-1250] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53885 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-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-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-09-03session.rb: SHA512nobu
* lib/cgi/session.rb (create_new_id): use SHA512 instead of MD5. pointed out by SARWAR JAHAN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-15cookie.rb: revert part of r50496nobu
* lib/cgi/cookie.rb (CGI::Cookie#secure): revert part of r50496, which is irrelevant to GH-887, as the document states that the argument must be a boolean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14* lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.xibbar
[fix GH-887] Patch by @martinpovolny git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-29cookie.rb: trailing commanobu
* lib/cgi/cookie.rb: add trailing comma for further lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-10* lib/cgi/session/pstore.rb: separated sample code.hsbt
* lib/open3.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-27* lib/cgi/core.rb: remove unused variables.hsbt
* lib/erb.rb: ditto. * lib/mkmf.rb: ditto. * lib/net/http/response.rb: ditto. * lib/optparse/version.rb: ditto. * lib/prime.rb: ditto. * lib/racc/parser.rb: ditto. * lib/rexml/document.rb: ditto. * lib/rexml/dtd/dtd.rb: ditto. * lib/rexml/element.rb: ditto. * lib/rexml/functions.rb: ditto. * lib/rexml/parsers/xpathparser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-10* lib/cgi/core.rb: Provide a mechanism to specify thexibbar
max_multipart_length of multipart data. [Feature #8370] patch by Leif Eriksen <leif.eriksen.au@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27* test/lib/minitest/unit.rb: Use Tempfile#close! instead ofakr
Tempfile#unlink to close file descriptors. * test/openssl/test_config.rb: Ditto. * test/ruby/test_io.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27* lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlinkakr
to close file descriptors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-28fix typo [Fix GH-603]nobu
* bootstraptest/test_literal.rb: fix typo of "dynamic". [ci skip] * regexp.rdoc: fix typo of "organized". [ci skip] * lib/session.rb: fix typo of "recognized". [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45737 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-01-19* lib/cgi/html.rb: fix typo by @windwiny [fix GH-506]hsbt
* lib/net/http.rb: ditto * lib/rexml/attribute.rb: ditto * lib/rexml/element.rb: ditto * lib/rexml/source.rb: ditto * lib/rexml/streamlistener.rb: ditto * lib/rss/xmlparser.rb: ditto * lib/rubygems/commands/generate_index_command.rb: ditto * lib/shell.rb: ditto * lib/uri/common.rb:ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr
it may be set before the body. Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247] * lib/cgi/core.rb: Ditto. * lib/drb/ssl.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-18* lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]zzak
Patch by Dave Worth https://github.com/ruby/ruby/pull/341 * lib/webrick.rb: ditto * lib/scanf.rb: ditto * lib/xmlrpc/config.rb: ditto * lib/resolv.rb: ditto * lib/e2mmap.rb: ditto * lib/fileutils.rb: ditto * lib/mkmf.rb: ditto * lib/cgi/session.rb: ditto * lib/yaml.rb: ditto * lib/erb.rb: ditto * lib/irb.rb: ditto * lib/tracer.rb: ditto * lib/net/http.rb: ditto * ext/syslog/lib/syslog/logger.rb: ditto * sample/pty/expect_sample.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-16* lib/cgi/util.rb (CGI::Util#escape, unescape): Unuse regexp specialxibbar
global variable. [Feature #8648] Thanks to fotos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19* lib/cgi/util.rb (CGI.escapeHTML): performance improvement.xibbar
thank you nagachika-san. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19* lib/cgi/util.rb(CGI.escapeHTML): performance improvement.xibbar
thank you @bbxiao1 via https://github.com/ruby/ruby/pull/333 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03* lib/cgi/cookie.rb (inspect): add inspect for debug.xibbar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02* lib/cgi/util.rb, lib/erb.rb: Use String#b [Feature #8394] by znzzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-16* lib/cgi/util.rb: Constant parameter is faster and economy thanxibbar
string parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-16* lib/cgi/core.rb: Constant parameter is faster and economy thanxibbar
string parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-16* lib/cgi/util.rb: Use String#b instead of dup.force_encoding("ASCII-8BIT")xibbar
[Feature #8394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-05* lib/cgi/session.rb: Fix a typo.xibbar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40587 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-19* lib/cgi/session.rb: update use rescue nil all becausexibbar
session delete shoud try all pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19* lib/cgi/session.rb: update use rescue Errno::ENOENT becausexibbar
session delete shoud try all pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e