author | Petr Nyc <Petr.Nyc@Oracle.COM> |
Tue, 08 Sep 2015 10:40:03 -0700 | |
branch | s11u3-sru |
changeset 4842 | 3661acf9f226 |
parent 884 | cd5a2da081ff |
permissions | -rw-r--r-- |
884
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1 |
diff -Naur perl-5.12.4/cpan/CGI/Changes CGI.pm-3.59/cpan/CGI/Changes |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2 |
--- perl-5.12.4/cpan/CGI/Changes 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
3 |
+++ CGI.pm-3.59/cpan/CGI/Changes 2011-12-30 05:28:52.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
4 |
@@ -1,10 +1,184 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
5 |
-Version 3.49 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
6 |
+Version 3.59 Dec 29th, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
7 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
8 |
+ [BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
9 |
+ - We no longer read from STDIN when the Content-Length is not set, preventing |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
10 |
+ requests with no Content-Length from freezing in some cases. This is consistent |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
11 |
+ with the CGI RFC 3875, and is also consistent with CGI::Simple. However, the old |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
12 |
+ behavior may have been expected by some command-line uses of CGI.pm. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
13 |
+ Thanks to Philip Potter and Yanick Champoux. See RT#52469 for details: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
14 |
+ https://rt.cpan.org/Public/Bug/Display.html?id=52469 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
15 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
16 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
17 |
+ - remove tmpdirs more aggressively. Thanks to rjbs (RT#73288) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
18 |
+ - use Text::ParseWords instead of ancient shellwords.pl. Thanks to AlexBio. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
19 |
+ - remove use of define(@arr). Thanks to rjbs. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
20 |
+ - spelling fixes. Thanks to Gregor Herrmann and Alessandro Ghedini. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
21 |
+ - fix test count and warning in t/fast.t. Thanks to Yanick. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
22 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
23 |
+Version 3.58 Nov 11th, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
24 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
25 |
+ [DOCUMENTATION] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
26 |
+ - Clarify that using query_string() only has defined behavior when using the GET method. (RT#60813) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
27 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
28 |
+Version 3.57 Nov 9th, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
29 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
30 |
+ - test failure in t/fast.t introduced in 3.56 is fixed. (Thanks to zefram and chansen). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
31 |
+ - Test::More requirement has been bumped to 0.98 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
32 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
33 |
+Version 3.56 Nov 8th, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
34 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
35 |
+ [SECURITY] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
36 |
+ Use public and documented FCGI.pm API in CGI::Fast |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
37 |
+ CGI::Fast was using an FCGI API that was deprecated and removed from |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
38 |
+ documentation more than ten years ago. Usage of this deprecated API with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
39 |
+ FCGI >= 0.70 or FCGI <= 0.73 introduces a security issue. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
40 |
+ <https://rt.cpan.org/Public/Bug/Display.html?id=68380> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
41 |
+ <http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
42 |
+ (Thanks to chansen) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
43 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
44 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
45 |
+ - tmp files are now cleaned up on VMS ( RT#69210, thanks to [email protected] ) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
46 |
+ - Fixed test failure: done_testing() added to url.t (Thanks to Ryan Jendoubi) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
47 |
+ - Clarify preferred bug submission location in docs, and note that Mark Stosberg |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
48 |
+ is the current maintainer. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
49 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
50 |
+Version 3.55 June 3rd, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
51 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
52 |
+ [THINGS THAT MAY BREAK YOUR CODE] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
53 |
+ url() was fixed to return "PATH_INFO" when it is explicitly requested |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
54 |
+ with either the path=>1 or path_info=>1 flag. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
55 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
56 |
+ If your code is running under mod_rewrite (or compatible) and you are calling self_url() or |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
57 |
+ you are calling url() and passing path_info=>1, These methods will actually be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
58 |
+ returning PATH_INFO now, as you have explicitly requested, or has self_url() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
59 |
+ has requested on your behalf. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
60 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
61 |
+ The PATH_INFO has been omitted in such URLs since the issue was introduced |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
62 |
+ in the 3.12 release in December, 2005. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
63 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
64 |
+ This bug is so old your application may have come to depend on it or |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
65 |
+ workaround it. Check for application before upgrading to this release. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
66 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
67 |
+ Examples of affected method calls: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
68 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
69 |
+ $q->url(-absolute => 1, -query => 1, -path_info => 1 ) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
70 |
+ $q->url(-path=>1) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
71 |
+ $q->url(-full=>1,-path=>1) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
72 |
+ $q->url(-rewrite=>1,-path=>1) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
73 |
+ $q->self_url(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
74 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
75 |
+Version 3.54, Apr 28, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
76 |
+ No code changes |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
77 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
78 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
79 |
+ - Address test failures in t/tmpdir.t, thanks to Niko Tyni. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
80 |
+ Some tests here are failing on some platforms and have been marked as TODO. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
81 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
82 |
+Version 3.53, Apr 25, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
83 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
84 |
+ [NEW FEATURES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
85 |
+ - The DELETE HTTP verb is now supported. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
86 |
+ (RT#52614, James Robson, Eduardo Ari�o de la Rubia) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
87 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
88 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
89 |
+ - Correct t/tmpdir.t MANIFEST entry. (RT#64949) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
90 |
+ - Update minimum required Perl version to be Perl 5.8.1, which |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
91 |
+ has been out since 2003. This allows us to drop some hacks |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
92 |
+ and exceptions (Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
93 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
94 |
+Version 3.52, Jan 24, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
95 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
96 |
+ [DOCUMENTATION] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
97 |
+ - The documentation for multi-line header handling was been updated to reflect |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
98 |
+ the changes in 3.51. (Mark Stosberg, [email protected]) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
99 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
100 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
101 |
+ - Add missing t/tmpfile.t file. (RT#64949) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
102 |
+ - Fix warning in t/cookie.t (RT#64570, Chris Williams, Rainer Tammer, Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
103 |
+ - Fixed logic bug in t/multipart_init.t (RT#64261, Niko Tyni) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
104 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
105 |
+Version 3.51, Jan 5, 2011 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
106 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
107 |
+ [NEW FEATURES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
108 |
+ - A new option to set $CGI::Carp::TO_BROWSER = 0, allows you to explicitly |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
109 |
+ exclude a particular scope from triggering printing to the browser when |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
110 |
+ fatatlsToBrowser is set. (RT#62783, Thanks to papowell) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
111 |
+ - The <script> tag now supports the "charset" attribute. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
112 |
+ (RT#62907, Thanks to Fabrice Metge) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
113 |
+ - In CGI::Cookie, "Max-Age" is now supported for better spec compliance. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
114 |
+ (Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
115 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
116 |
+ [BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
117 |
+ - Setting charset() now works for all content types, not just "text/*". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
118 |
+ (RT#57945, Thanks to Yanick and Gerv.) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
119 |
+ - support for user temporary directories ($HOME/tmp) was commented out |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
120 |
+ in 2.61 but the documentation wasn't updated (Peter Gervai, Niko Tyni) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
121 |
+ - setting $CGITempFile::TMPDIRECTORY before loading CGI.pm has been |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
122 |
+ working but undocumented since 3.12 (which listed it in Changes as |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
123 |
+ $CGI::TMPDIRECTORY) (Peter Gervai, Niko Tyni) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
124 |
+ - unfortunately the previous change broke the runtime check for looking |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
125 |
+ for a new temporary directory if the current one suddenly became |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
126 |
+ unwritable (Peter Gervai, Niko Tyni) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
127 |
+ - A bug was fixed in CGI::Carp triggered by certain death cases in |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
128 |
+ the BEGIN phase of parent classes. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
129 |
+ (RT#57224, Thanks to UNERA, Yanick Champoux, Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
130 |
+ - CGI::Cookie->new() now follows the documentation and returns undef |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
131 |
+ if the -name and -value args aren't provided. This new behavior is also |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
132 |
+ consistent with the docs and code of CGI::Simple::Cookie. (Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
133 |
+ - CGI::Cookie->parse() now trims leading and trailing whitespace from cookie |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
134 |
+ elements as intended. The change also makes this part of the parsing |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
135 |
+ identical to CGI::Simple::Cookie (Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
136 |
+ - Temp file handling was improved (RT#62762) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
137 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
138 |
+ [SECURITY] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
139 |
+ - Further improvements have been made to guard against newline injections |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
140 |
+ in headers. (Thanks to Max Kanat-Alexander, Yanick Champoux, Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
141 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
142 |
+ [PERFORMANCE] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
143 |
+ - Make EBCDIC a compile-time constant so there's zero overhead (and less |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
144 |
+ compiled code) in subroutines that test for it. (Tim Bunce) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
145 |
+ - If you just want to use CGI::Cookie, CGI.pm will no longer be loaded |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
146 |
+ unless you call the bake() method, which requires it. (Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
147 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
148 |
+ [DOCUMENTATION] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
149 |
+ - quit referring to the <link> tag as being "rarely used". (Victor Sanders) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
150 |
+ - typo and whitespace fixes (RT#62785, thanks to [email protected]) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
151 |
+ - The -dtd argument to start_html() is now documented |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
152 |
+ (RT#60473, Thanks to giecrilj and [email protected]) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
153 |
+ - CGI::Carp doc are updated to reflect that it can work with mod_perl 2.0. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
154 |
+ - when creating a temporary file in the directory fails, the error message |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
155 |
+ could indicate the root of the problem better (Peter Gervai, Niko Tyni) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
156 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
157 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
158 |
+ - Re-fixing https test in http.t. (RT#54768, thanks to SPROUT) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
159 |
+ - param_fetch no longer triggers a warning when called with no arguments (ysth, Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
160 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
161 |
+Version 3.50, Nov 8, 2010 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
162 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
163 |
+ [SECURITY] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
164 |
+ 1. The MIME boundary in multipart_init is now random. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
165 |
+ Thanks to Byron Jones, Masahiro Yamada, Reed Loden, and Mark Stosberg |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
166 |
+ 2. Further improvements to handling of newlines embedded in header values. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
167 |
+ An exception is thrown if header values contain invalid newlines. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
168 |
+ Thanks to Michal Zalewski, Max Kanat-Alexander, Yanick Champoux, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
169 |
+ Lincoln Stein, Fr�d�ric Buclin and Mark Stosberg |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
170 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
171 |
+ [DOCUMENTATION] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
172 |
+ 1. Correcting/clarifying documentation for param_fetch(). Thanks to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
173 |
+ Ren�e B�cker. (RT#59132) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
174 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
175 |
+ [INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
176 |
+ 1. Fixing https test in http.t. (RT#54768) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
177 |
+ 2. Tests were added for multipart_init(). Thanks to Mark Stosberg and CGI::Simple. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
178 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
179 |
+Version 3.49, Feb 5th, 2010 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
180 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
181 |
[BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
182 |
1. Fix a regression since 3.44 involving a case when the header includes "Content-Length: 0". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
183 |
Thanks to Alex Vandiver (RT#51109) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
184 |
2. Suppress uninitialized warnings under -w. Thanks to burak. (RT#50301) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
185 |
3. url() now uses virtual_port() instead of server_port(). Thanks to MKANAT and Yanick Champoux. (RT#51562) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
186 |
+ 4. CGI::Carp now properly handles stringifiable objects, like Exception::Class throws (RT#39904) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
187 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
188 |
[SECURITY] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
189 |
1. embedded newlines are now filtered out of header values in header(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
190 |
@@ -18,7 +192,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
191 |
1. More tests were added for autoescape, thanks to Bob Kuo. (RT#25485) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
192 |
2. Attempt to avoid test failures with t/fast, thanks to Steve Hay. (RT#49599) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
193 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
194 |
-Version 3.48 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
195 |
+Version 3.48, Sep 25, 2009 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
196 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
197 |
[BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
198 |
1. <optgroup> default values are now properly escaped. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
199 |
@@ -35,14 +209,15 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
200 |
[INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
201 |
1. More tests were added for autoescape, thanks to Bob Kuo. (RT#25485) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
202 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
203 |
-Version 3.47 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
204 |
- Released September 9th, 2009. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
205 |
+Version 3.47, Sep 9, 2009 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
206 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
207 |
No code changes. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
208 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
209 |
[INTERNALS] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
210 |
Re-release of 3.46, which did not contain a proper MANIFEST |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
211 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
212 |
Version 3.46 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
213 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
214 |
[BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
215 |
1. In CGI::Pretty, we no longer add line breaks after tags we claim not to format. Thanks to rrt, Bob Kuo and |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
216 |
and Mark Stosberg. (RT#42114). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
217 |
@@ -66,7 +241,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
218 |
11.Calling CGI->new() no longer clobbers the value of $_ in the current scope. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
219 |
Thanks to Alexey Tourbin, Bob Kuo and Mark Stosberg. (RT#25131) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
220 |
12.UTF-8 params should not get double-decoded now. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
221 |
- Thanks to Yves, Bodo, Burak G�rsoy, and Michael Schout. (RT#19913) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
222 |
+ Thanks to Yves, Bodo, Burak G�rsoy, and Michael Schout. (RT#19913) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
223 |
13.We now give objects passed to CGI::Carp::die a chance to be stringified. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
224 |
Thanks to teek and Yanick Champoux (RT#41530) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
225 |
14.Turning off autoEscape() now only affects the behavior of built-in HTML |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
226 |
@@ -95,7 +270,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
227 |
2. Automated tests for hidden() have been added, thanks to Russel Jenkins and Mark Stosberg (RT#20436) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
228 |
3. t/util.t has been updated to use Test::More instead of a home-grown test function. Thanks to Bob Kuo. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
229 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
230 |
-Version 3.45 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
231 |
+Version 3.45, Aug 14, 2009 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
232 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
233 |
[BUG FIXES] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
234 |
1. Prevent warnings about "uninitialized values" for REQUEST_URI, HTTP_USER_AGENT and other environment variables. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
235 |
Patches by Callum Gibson, heiko and Mark Stosberg. (RT#24684, RT#29065) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
236 |
@@ -113,7 +289,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
237 |
8. Support for <optgroup> with scrolling_list() now works the same way as it does for popup_menu(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
238 |
Thanks to Stuart Johnston (RT#30097) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
239 |
9. CGI::Pretty now works properly when $" is set to ''. Thanks to Jim Keenan (RT#12401) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
240 |
- 10. Fix crash when used in combination with PerlEx::DBI. Thanks to Burak G�rsoy (RT#19902) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
241 |
+ 10. Fix crash when used in combination with PerlEx::DBI. Thanks to Burak G�rsoy (RT#19902) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
242 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
243 |
[DOCUMENTATION] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
244 |
1. Several typos were fixed, Thanks to ambs. (RT#41105) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
245 |
@@ -134,41 +310,48 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
246 |
4. CGI::Switch and CGI::Apache now properly set their VERSION in their own name space. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
247 |
Thanks to Alexey Tourbin (RT#11941,RT#11942) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
248 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
249 |
- Version 3.44 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
250 |
+Version 3.44, Jul 30, 2009 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
251 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
252 |
1. Patch from Kurt Jaeger to allow HTTP PUT even if the content length is unknown. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
253 |
2. Patch from Pavel merdin to fix a problem for one of the FireFox addons. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
254 |
3. Fixed issue in mod_perl & fastCGI environment of cookies returned from |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
255 |
CGI->cookie() leaking from one session to another. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
256 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
257 |
- Version 3.43 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
258 |
+Version 3.43, Apr 06, 2009 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
259 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
260 |
1. Documentation patch from [email protected] to replace all occurrences of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
261 |
"new CGI" with CGI->new()" to reflect best perl practices. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
262 |
2. Patch from Stepan Kasal to fix utf-8 related problems in perl 5.10 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
263 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
264 |
- Version 3.42 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
265 |
+Version 3.42, Sep 08, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
266 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
267 |
1. Added patch from Renee Baecker that makes it possible to subclass |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
268 |
CGI::Pretty. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
269 |
2. Added patch from Nicholas Clark to allow ~ characters in temporary directories. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
270 |
3. Added patch from Renee Baecker that fixes the inappropriate escaping of fields |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
271 |
in multipart headers. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
272 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
273 |
- Version 3.41 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
274 |
+Version 3.41, Aug 25, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
275 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
276 |
1. Fix url() returning incorrect path when query string contains escaped newline. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
277 |
2. Added additional windows temporary directories and environment variables, courtesy patch from Renee Baecker |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
278 |
3. Added a handle() method to the lightweight upload |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
279 |
filehandles. This method returns a real IO::Handle object. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
280 |
4. Added patch from Tony Vanlingen to fix deep recursion warnings in CGI::Pretty. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
281 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
282 |
- Version 3.40 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
283 |
+Version 3.40, Aug 06, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
284 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
285 |
1. Fixed CGI::Fast docs to eliminate references to a "special" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
286 |
version of Perl. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
287 |
2. Makefile.PL now depends on FCGI so that CGI::Fast installs properly. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
288 |
3. Fix script_name() call from Stephane Chazelas. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
289 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
290 |
- Version 3.39 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
291 |
+Version 3.39, Jun 29, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
292 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
293 |
1. Fixed regression in "exists" function when using tied interface to CGI via $q->Vars. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
294 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
295 |
- Version 3.38 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
296 |
+Version 3.38, Jun 25, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
297 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
298 |
1. Fix annoying warning in http://rt.cpan.org/Ticket/Display.html?id=34551 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
299 |
2. Added nobr() function http://rt.cpan.org/Ticket/Display.html?id=35377 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
300 |
3. popup_menu() allows multiple items to be selected by default, satisfying |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
301 |
@@ -179,56 +362,68 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
302 |
6. Fixed minor warning described at http://rt.cpan.org/Public/Bug/Display.html?id=36435 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
303 |
7. Fixed overlap of attribute and parameter space described in http://rt.perl.org/rt3//Ticket/Display.html?id=24294 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
304 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
305 |
- Version 3.37 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
306 |
+Version 3.37, Apr 22, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
307 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
308 |
1. Fix pragmas so that they persist over modperl invocations (e.g. RT 34761) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
309 |
2. Fixed handling of chunked multipart uploads; thanks to Michael Bernhardt |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
310 |
who reported and fixed the problem. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
311 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
312 |
- Version 3.36 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
313 |
+Version 3.36 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
314 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
315 |
1. Fix CGI::Cookie to support cookies that are separated by "," instead of ";". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
316 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
317 |
- Version 3.35 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
318 |
+Version 3.35, Mar 27, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
319 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
320 |
1. Resync with bleadperl, primarily fixing a bug in parsing semicolons in uploaded filenames. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
321 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
322 |
- Version 3.34 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
323 |
+Version 3.34, Mar 18, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
324 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
325 |
1. Handle Unicode %uXXXX escapes properly -- patch from [email protected] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
326 |
2. Fix url() method to not choke on path names that contain regex characters. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
327 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
328 |
- Version 3.33 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
329 |
+Version 3.33, Jan 02, 2008 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
330 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
331 |
1. Remove uninit variable warning when calling url(-relative=>1) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
332 |
2. Fix uninit variable warnings for two lc calls |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
333 |
3. Fixed failure of tempfile upload due to sprintf() taint failure in perl 5.10 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
334 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
335 |
- Version 3.32 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
336 |
+Version 3.32, Dec 27, 2007 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
337 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
338 |
1. Patch from Miguel Santinho to prevent sending premature headers under mod_perl 2.0 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
339 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
340 |
- Version 3.31 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
341 |
+Version 3.31, Nov 30, 2007 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
342 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
343 |
1. Patch from Xavier Robin so that CGI::Carp issues a 500 Status code rather than a 200 status code. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
344 |
2. Patch from Alexander Klink to select correct temporary directory in OSX Leopard so that upload works. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
345 |
3. Possibly fixed "wrapped pack" error on 5.10 and higher. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
346 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
347 |
- Version 3.30 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
348 |
+Version 3.30 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
349 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
350 |
1. Patch from Mike Barry to handle POSTDATA in the same way as PUT. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
351 |
2. Patch from Rafael Garcia-Suarez to correctly reencode unicode values as byte values. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
352 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
353 |
- Version 3.29 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
354 |
+Version 3.29, Apr 16, 2007 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
355 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
356 |
1. The position of file handles is now reset to zero when CGI->new is called. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
357 |
(Mark Stosberg) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
358 |
2. uploadInfo() now works across multiple object instances. Also, the first |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
359 |
tests for uploadInfo() were added as part of the fix. (CPAN bug 11895, with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
360 |
contributions from drfrench and Mark Stosberg). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
361 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
362 |
- Version 3.28 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
363 |
+Version 3.28, Mar 29, 2007 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
364 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
365 |
1. Applied patch from Allen Day that makes Cookie parsing RFC2109 compliant |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
366 |
(attribute/values can be separated by commas as well as semicolons). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
367 |
2. Applied patch from Stephan Struckmann that allows script_name() to be set correctly. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
368 |
3. Fixed problem with url(-full) in which port number appears twice. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
369 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
370 |
- Version 3.27 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
371 |
+Version 3.27, Feb 27, 2007 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
372 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
373 |
1. Applied patch from Steve Taylor that allows checkbox_groups to be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
374 |
disabled with a new -disabled=> option. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
375 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
376 |
- Version 3.26 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
377 |
+Version 3.26 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
378 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
379 |
1. Fixed alternate stylesheet behavior so that it is insensitive to order of declarations. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
380 |
2. Patch from John Binns to allow users to provide a callback to CGI::Carp. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
381 |
3. Added "~" as an unreserved character in escape(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
382 |
@@ -236,31 +431,37 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
383 |
5. Fixed outdated documentation (and behavior) of -language in start_html -script option. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
384 |
6. Fixed bug in seconds calculation in CGI::Util::expire_calc. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
385 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
386 |
- Version 3.25 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
387 |
+Version 3.25, Sep 28, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
388 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
389 |
1. Fixed the link to the Netscape frames page. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
390 |
2. Added ability to specify an alternate stylesheet. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
391 |
3. Add support for XForms POST submssion both as application/xml or as multipart/related |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
392 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
393 |
- Version 3.24 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
394 |
+Version 3.24 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
395 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
396 |
1. In startform(), if request_uri() returns undef, then falls back |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
397 |
to self_url(). This should rarely happen except when run outside of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
398 |
the CGI environment. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
399 |
2. image button alignment options were mistakenly being capitalized, causing xhtml validation to fail. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
400 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
401 |
- Version 3.23 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
402 |
+Version 3.23, Aug 23, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
403 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
404 |
1. Typo in upload() persisted, now fixed for real. Thanks to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
405 |
Emanuele Zeppieri for correct patch and regression test. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
406 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
407 |
- Version 3.22 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
408 |
+Version 3.22, Aug 23, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
409 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
410 |
1. Typo in upload() function broke uploads. Now fixed (CPAN bug 21126). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
411 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
412 |
- Version 3.21 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
413 |
+Version 3.21, Aug 21, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
414 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
415 |
1. Don't try to read data at all when POST > $POST_MAX. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
416 |
2. Fixed bug that caused $cgi->param('name',undef,'value') to unset param('name') entirely. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
417 |
3. Fixed bug in which upload() sometimes returns empty. (CPAN bug #12694). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
418 |
4. Incorporated patch from [email protected] to support HTTPcookies (CPAN bug 21019). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
419 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
420 |
- Version 3.20 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
421 |
+Version 3.20 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
422 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
423 |
1. Patch from David Wheeler for CGI::Cookie->bake(). Uses mod_perl headers_out->add() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
424 |
rather than headers_out->set(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
425 |
2. Fixed problem identified by Andrei Voronkov in which start_form() output was screwed |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
426 |
@@ -268,7 +469,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
427 |
3. Quashed uninitialized variable warnings coming from script_name(), url() and other |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
428 |
functions that require access to the PATH_INFO environment variable. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
429 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
430 |
- Version 3.19 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
431 |
+Version 3.19 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
432 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
433 |
1. Added patch from Stephen Frost that allows one to suppress use of the temp file that is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
434 |
created during uploads. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
435 |
2. Fixed problem noted by Martin Foster in which regular expression meta-character terms |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
436 |
@@ -277,12 +479,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
437 |
3. More fixes to the url() method. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
438 |
4. Removed "hack to fix broken PATH_INFO in MSII". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
439 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
440 |
- Version 3.18 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
441 |
+Version 3.18 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
442 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
443 |
1. Doc typo fixes. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
444 |
2. Patch from Steve Peters to default the document type to match the charset. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
445 |
3. Fixed param() so that param(-name=>'foo',-values=>[]) sets the parameter to empty list. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
446 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
447 |
- Version 3.17 Fri Feb 24 14:01:27 EST 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
448 |
+Version 3.17, Feb 24, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
449 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
450 |
1. Added patch from Mike Hanafey which caused 0 arguments to CGI::Cookie->new() to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
451 |
be treated as empty. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
452 |
2. Patch to CGI::Carp from Peter Whaite to fix the unfixable problem of CGI::Carp |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
453 |
@@ -291,7 +495,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
454 |
with another's variables. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
455 |
4. Fixed upload failure on files that contain semicolons in their names. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
456 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
457 |
- Version 3.16 Wed Feb 8 13:29:11 EST 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
458 |
+Version 3.16, Feb 8, 2006 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
459 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
460 |
1. header() -charset option now works even when the MIME type is not "text". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
461 |
2. Fixed documentation for cookie() function and fastCGI. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
462 |
3. Upload filehandles now only closed automatically on Windows systems. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
463 |
@@ -302,16 +507,20 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
464 |
but was "Moved". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
465 |
7. Fixed charset in start_html() and header() to be in synch. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
466 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
467 |
- Version 3.15 Wed Dec 7 15:13:22 EST 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
468 |
+Version 3.15, Dec 7, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
469 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
470 |
1. Remove extraneous "?" from self_url() when URI contains a ? but no query string. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
471 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
472 |
- Version 3.14 Tue Dec 6 17:12:03 EST 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
473 |
+Version 3.14, Dec 6, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
474 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
475 |
1. Fixed broken scrolling_list() select attribute. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
476 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
477 |
- Version 3.13 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
478 |
+Version 3.13, Dec 4, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
479 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
480 |
1. Removed extraneous empty "?" from end of self_url(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
481 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
482 |
- Version 3.12 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
483 |
+Version 3.12, Dec 4, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
484 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
485 |
1. Fixed virtual_port so that it works properly with https protocol. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
486 |
2. Fixed documentation for upload_hook(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
487 |
3. Added POSTDATA documentation. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
488 |
@@ -328,7 +537,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
489 |
9. Fixed CGI::Carp to work correctly with Mod_perl 1.29 in an Apache 2 environment. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
490 |
10. Setting $CGI::TMPDIRECTORY should now be effective. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
491 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
492 |
- Version 3.11 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
493 |
+Version 3.11, Aug 3, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
494 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
495 |
1. Killed warning in CGI::Cookie about MOD_PERL_API_VERSION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
496 |
2. Fixed append() so that it works in function mode. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
497 |
3. Workaround for a bug that appears in Apache2 versions through 2.0.54 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
498 |
@@ -338,21 +548,25 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
499 |
not handle the uncommon case of a ScriptAlias directive that adds additional |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
500 |
path information to the end of the translated URI. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
501 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
502 |
- Version 3.10 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
503 |
+Version 3.10, May 13, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
504 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
505 |
1. Added Apache2::RequestIO, which is necessary for mp2 interoperability. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
506 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
507 |
- Version 3.09 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
508 |
+Version 3.09, May 5, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
509 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
510 |
1. Fixed tabindex="0" when using CGI to create forms without a prior start_html |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
511 |
2. Removed warning about non-numeric MOD_PERL_API_VERSION. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
512 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
513 |
- Version 3.08 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
514 |
+Version 3.08, Apr 20, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
515 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
516 |
1. update support for mod_perl 2.0. versions prior to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
517 |
mod_perl 1.999_22 (2.0.0-RC5) are no longer supported. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
518 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
519 |
- Version 3.07 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
520 |
+Version 3.07, Mar 14, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
521 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
522 |
1. Fixed typo in mod_perl detection. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
523 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
524 |
- Version 3.06 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
525 |
+Version 3.06, Mar 09, 2005 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
526 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
527 |
1. Fixed bare call to script() in start_html |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
528 |
2. Moved Fh::DESTROY out of autoloaded functions so as to avoid |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
529 |
@@ -381,7 +595,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
530 |
higher perls (fix courtesy Slaven Rezic). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
531 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
532 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
533 |
- Version 3.05 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
534 |
+Version 3.05, Apr 12, 2004 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
535 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
536 |
1. Fixed uninitialized variable warning on start_form() when running |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
537 |
from command line. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
538 |
@@ -414,23 +628,23 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
539 |
15. Fixed documentation bug in -style argument to start_html() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
540 |
16. Added -status argument to redirect(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
541 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
542 |
- Version 3.04 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
543 |
+Version 3.04, Jan 18, 2004 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
544 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
545 |
1. Fixed the problem with mod_perl crashing when "defaults" button |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
546 |
pressed. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
547 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
548 |
- Version 3.03 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
549 |
+Version 3.03, Jan 13, 2004 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
550 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
551 |
1. Fix upload hook functionality |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
552 |
2. Workaround for CGI->unescape_html() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
553 |
3. Bumped version numbers in CGI::Fast and CGI::Util for 5.8.3-tobe |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
554 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
555 |
- Version 3.02 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
556 |
+Version 3.02 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
557 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
558 |
1. Bring in Apache::Response just in case. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
559 |
2. File upload on EBCDIC systems now works. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
560 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
561 |
- Version 3.01 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
562 |
+Version 3.01, Dec 10, 2003 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
563 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
564 |
1. No fix yet for upload failures when running on EBCDIC server. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
565 |
2. Fixed uninitialized glob warnings that appeared when file |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
566 |
@@ -453,7 +667,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
567 |
12. Added virtual_port() method for finding out what port server is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
568 |
listening on in a virtual-host aware fashion. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
569 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
570 |
- Version 3.00 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
571 |
+Version 3.00, Aug 18, 2003 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
572 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
573 |
1. Patch from Randal Schwartz to fix bug introduced by cross-site |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
574 |
scripting vulnerability "fix." |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
575 |
@@ -607,7 +821,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
576 |
Version 2.83 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
577 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
578 |
1. Fixed autoEscape() documentation inconsistencies. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
579 |
- 2. Patch from Ville Skytt� to fix a number of XHTML inconsistencies. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
580 |
+ 2. Patch from Ville Skytt� to fix a number of XHTML inconsistencies. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
581 |
3. Added Max-Age to list of CGI::Cookie headers. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
582 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
583 |
Version 2.82 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
584 |
@@ -1062,7 +1276,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
585 |
21. Fixed warning in initialize_globals() under mod_perl. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
586 |
22. File uploads from Macintosh versions of MSIE should now work. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
587 |
23. Pragmas now preceded by dashes (-nph) rather than colons (:nph). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
588 |
- Old style is supported for backward compatability. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
589 |
+ Old style is supported for backward compatibility. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
590 |
24. Can now pass arguments to all functions using {} brackets, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
591 |
resolving historical inconsistencies. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
592 |
25. Removed autoloader warnings about absent MultipartBuffer::DESTROY. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
593 |
@@ -1294,7 +1508,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
594 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
595 |
1. Added cookie() support routines. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
596 |
2. Added -expires parameter to header(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
597 |
- 3. Added cgi-lib.pl compatability mode. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
598 |
+ 3. Added cgi-lib.pl compatibility mode. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
599 |
4. Made the module more configurable for different operating systems. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
600 |
5. Fixed a dumb bug in JavaScript button() method. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
601 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
602 |
@@ -1424,7 +1638,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
603 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
604 |
1. The user_agent() method is now documented; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
605 |
2. A potential security hole in import() is now plugged. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
606 |
- 3. Changed name of import() to import_names() for compatability with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
607 |
+ 3. Changed name of import() to import_names() for compatibility with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
608 |
CGI:: modules. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
609 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
610 |
Bug fixes in version 1.53 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
611 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Carp.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Carp.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
612 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Carp.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
613 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Carp.pm 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
614 |
@@ -116,7 +116,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
615 |
Nonfatal errors will still be directed to the log file only (unless redirected |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
616 |
with carpout). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
617 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
618 |
-Note that fatalsToBrowser does B<not> work with mod_perl version 2.0 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
619 |
+Note that fatalsToBrowser may B<not> work well with mod_perl version 2.0 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
620 |
and higher. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
621 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
622 |
=head2 Changing the default message |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
623 |
@@ -183,6 +183,28 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
624 |
this module's functionality, or this module may interfere with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
625 |
your module's functionality. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
626 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
627 |
+=head2 SUPPRESSING PERL ERRORS APPEARING IN THE BROWSER WINDOW |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
628 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
629 |
+A problem sometimes encountered when using fatalsToBrowser is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
630 |
+when a C<die()> is done inside an C<eval> body or expression. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
631 |
+Even though the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
632 |
+fatalsToBrower support takes precautions to avoid this, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
633 |
+you still may get the error message printed to STDOUT. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
634 |
+This may have some undesireable effects when the purpose of doing the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
635 |
+eval is to determine which of several algorithms is to be used. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
636 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
637 |
+By setting C<$CGI::Carp::TO_BROWSER> to 0 you can suppress printing the C<die> messages |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
638 |
+but without all of the complexity of using C<set_die_handler>. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
639 |
+You can localize this effect to inside C<eval> bodies if this is desireable: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
640 |
+For example: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
641 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
642 |
+ eval { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
643 |
+ local $CGI::Carp::TO_BROWSER = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
644 |
+ die "Fatal error messages not sent browser" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
645 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
646 |
+ # $@ will contain error message |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
647 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
648 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
649 |
=head1 MAKING WARNINGS APPEAR AS HTML COMMENTS |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
650 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
651 |
It is now also possible to make non-fatal errors appear as HTML |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
652 |
@@ -245,6 +267,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
653 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
654 |
=head1 CHANGE LOG |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
655 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
656 |
+3.51 Added $CGI::Carp::TO_BROWSER |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
657 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
658 |
1.29 Patch from Peter Whaite to fix the unfixable problem of CGI::Carp |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
659 |
not behaving correctly in an eval() context. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
660 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
661 |
@@ -321,9 +345,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
662 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
663 |
$main::SIG{__WARN__}=\&CGI::Carp::warn; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
664 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
665 |
-$CGI::Carp::VERSION = '3.45'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
666 |
+$CGI::Carp::VERSION = '3.51'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
667 |
$CGI::Carp::CUSTOM_MSG = undef; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
668 |
$CGI::Carp::DIE_HANDLER = undef; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
669 |
+$CGI::Carp::TO_BROWSER = 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
670 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
671 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
672 |
# fancy import routine detects and handles 'errorWrap' specially. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
673 |
@@ -421,23 +446,27 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
674 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
675 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
676 |
sub die { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
677 |
- my ($arg,@rest) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
678 |
+ # if no argument is passed, propagate $@ like |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
679 |
+ # the real die |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
680 |
+ my ($arg,@rest) = @_ ? @_ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
681 |
+ : $@ ? "$@\t...propagated" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
682 |
+ : "Died" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
683 |
+ ; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
684 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
685 |
&$DIE_HANDLER($arg,@rest) if $DIE_HANDLER; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
686 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
687 |
+ # the "$arg" is done on purpose! |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
688 |
# if called as die( $object, 'string' ), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
689 |
# all is stringified, just like with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
690 |
# the real 'die' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
691 |
$arg = join '' => "$arg", @rest if @rest; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
692 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
693 |
- $arg ||= 'Died'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
694 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
695 |
my($file,$line,$id) = id(1); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
696 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
697 |
$arg .= " at $file line $line.\n" unless ref $arg or $arg=~/\n$/; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
698 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
699 |
realdie $arg if ineval(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
700 |
- &fatalsToBrowser($arg) if $WRAP; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
701 |
+ &fatalsToBrowser($arg) if ($WRAP and $CGI::Carp::TO_BROWSER); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
702 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
703 |
$arg=~s/^/ stamp() /gme if $arg =~ /\n$/ or not exists $ENV{MOD_PERL}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
704 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
705 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Cookie.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Cookie.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
706 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Cookie.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
707 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Cookie.pm 2011-01-05 10:14:15.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
708 |
@@ -12,23 +12,20 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
709 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
710 |
# Copyright 1995-1999, Lincoln D. Stein. All rights reserved. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
711 |
# It may be used and modified freely, but I do request that this copyright |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
712 |
-# notice remain attached to the file. You may modify this module as you |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
713 |
+# notice remain attached to the file. You may modify this module as you |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
714 |
# wish, but if you redistribute a modified version, please attach a note |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
715 |
# listing the modifications you have made. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
716 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
717 |
-$CGI::Cookie::VERSION='1.29'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
718 |
+our $VERSION='1.30'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
719 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
720 |
use CGI::Util qw(rearrange unescape escape); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
721 |
-use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
722 |
-use overload '""' => \&as_string, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
723 |
- 'cmp' => \&compare, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
724 |
- 'fallback'=>1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
725 |
+use overload '""' => \&as_string, 'cmp' => \&compare, 'fallback' => 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
726 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
727 |
my $PERLEX = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
728 |
# Turn on special checking for ActiveState's PerlEx |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
729 |
$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
730 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
731 |
-# Turn on special checking for Doug MacEachern's modperl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
732 |
+# Turn on special checking for mod_perl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
733 |
# PerlEx::DBI tries to fool DBI by setting MOD_PERL |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
734 |
my $MOD_PERL = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
735 |
if (exists $ENV{MOD_PERL} && ! $PERLEX) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
736 |
@@ -60,20 +57,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
737 |
my($key,$value); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
738 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
739 |
my @pairs = split("[;,] ?",$raw_cookie); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
740 |
- foreach (@pairs) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
741 |
- s/\s*(.*?)\s*/$1/; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
742 |
- if (/^([^=]+)=(.*)/) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
743 |
- $key = $1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
744 |
- $value = $2; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
745 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
746 |
- else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
747 |
- $key = $_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
748 |
- $value = ''; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
749 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
750 |
- $results{$key} = $value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
751 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
752 |
- return \%results unless wantarray; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
753 |
- return %results; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
754 |
+ for my $pair ( @pairs ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
755 |
+ $pair =~ s/^\s+|\s+$//g; # trim leading trailing whitespace |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
756 |
+ my ( $key, $value ) = split "=", $pair; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
757 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
758 |
+ $value = defined $value ? $value : ''; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
759 |
+ $results{$key} = $value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
760 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
761 |
+ return wantarray ? %results : \%results; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
762 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
763 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
764 |
sub get_raw_cookie { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
765 |
@@ -93,11 +84,15 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
766 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
767 |
sub parse { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
768 |
my ($self,$raw_cookie) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
769 |
+ return wantarray ? () : {} unless $raw_cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
770 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
771 |
my %results; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
772 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
773 |
my @pairs = split("[;,] ?",$raw_cookie); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
774 |
- foreach (@pairs) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
775 |
- s/\s*(.*?)\s*/$1/; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
776 |
+ for (@pairs) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
777 |
+ s/^\s+//; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
778 |
+ s/\s+$//; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
779 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
780 |
my($key,$value) = split("=",$_,2); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
781 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
782 |
# Some foreign cookies are not in name=value format, so ignore |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
783 |
@@ -113,49 +108,37 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
784 |
# appear. The FIRST one in HTTP_COOKIE is the most recent version. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
785 |
$results{$key} ||= $self->new(-name=>$key,-value=>\@values); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
786 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
787 |
- return \%results unless wantarray; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
788 |
- return %results; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
789 |
+ return wantarray ? %results : \%results; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
790 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
791 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
792 |
sub new { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
793 |
- my $class = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
794 |
- $class = ref($class) if ref($class); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
795 |
- # Ignore mod_perl request object--compatability with Apache::Cookie. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
796 |
- shift if ref $_[0] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
797 |
- && eval { $_[0]->isa('Apache::Request::Req') || $_[0]->isa('Apache') }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
798 |
- my($name,$value,$path,$domain,$secure,$expires,$httponly) = |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
799 |
- rearrange([ 'NAME', ['VALUE','VALUES'], qw/ PATH DOMAIN SECURE EXPIRES |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
800 |
- HTTPONLY / ], @_); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
801 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
802 |
- # Pull out our parameters. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
803 |
- my @values; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
804 |
- if (ref($value)) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
805 |
- if (ref($value) eq 'ARRAY') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
806 |
- @values = @$value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
807 |
- } elsif (ref($value) eq 'HASH') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
808 |
- @values = %$value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
809 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
810 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
811 |
- @values = ($value); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
812 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
813 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
814 |
- bless my $self = { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
815 |
- 'name'=>$name, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
816 |
- 'value'=>[@values], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
817 |
- },$class; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
818 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
819 |
- # IE requires the path and domain to be present for some reason. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
820 |
- $path ||= "/"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
821 |
- # however, this breaks networks which use host tables without fully qualified |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
822 |
- # names, so we comment it out. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
823 |
- # $domain = CGI::virtual_host() unless defined $domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
824 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
825 |
- $self->path($path) if defined $path; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
826 |
- $self->domain($domain) if defined $domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
827 |
- $self->secure($secure) if defined $secure; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
828 |
- $self->expires($expires) if defined $expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
829 |
- $self->httponly($httponly) if defined $httponly; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
830 |
-# $self->max_age($expires) if defined $expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
831 |
+ my ( $class, @params ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
832 |
+ $class = ref( $class ) || $class; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
833 |
+ # Ignore mod_perl request object--compatibility with Apache::Cookie. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
834 |
+ shift if ref $params[0] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
835 |
+ && eval { $params[0]->isa('Apache::Request::Req') || $params[0]->isa('Apache') }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
836 |
+ my ( $name, $value, $path, $domain, $secure, $expires, $max_age, $httponly ) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
837 |
+ = rearrange( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
838 |
+ [ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
839 |
+ 'NAME', [ 'VALUE', 'VALUES' ], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
840 |
+ 'PATH', 'DOMAIN', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
841 |
+ 'SECURE', 'EXPIRES', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
842 |
+ 'MAX-AGE','HTTPONLY' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
843 |
+ ], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
844 |
+ @params |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
845 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
846 |
+ return undef unless defined $name and defined $value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
847 |
+ my $self = {}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
848 |
+ bless $self, $class; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
849 |
+ $self->name( $name ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
850 |
+ $self->value( $value ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
851 |
+ $path ||= "/"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
852 |
+ $self->path( $path ) if defined $path; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
853 |
+ $self->domain( $domain ) if defined $domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
854 |
+ $self->secure( $secure ) if defined $secure; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
855 |
+ $self->expires( $expires ) if defined $expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
856 |
+ $self->max_age($expires) if defined $max_age; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
857 |
+ $self->httponly( $httponly ) if defined $httponly; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
858 |
return $self; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
859 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
860 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
861 |
@@ -163,23 +146,24 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
862 |
my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
863 |
return "" unless $self->name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
864 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
865 |
- my(@constant_values,$domain,$path,$expires,$max_age,$secure,$httponly); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
866 |
+ no warnings; # some things may be undefined, that's OK. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
867 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
868 |
+ my $name = escape( $self->name ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
869 |
+ my $value = join "&", map { escape($_) } $self->value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
870 |
+ my @cookie = ( "$name=$value" ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
871 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
872 |
+ push @cookie,"domain=".$self->domain if $self->domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
873 |
+ push @cookie,"path=".$self->path if $self->path; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
874 |
+ push @cookie,"expires=".$self->expires if $self->expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
875 |
+ push @cookie,"max-age=".$self->max_age if $self->max_age; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
876 |
+ push @cookie,"secure" if $self->secure; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
877 |
+ push @cookie,"HttpOnly" if $self->httponly; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
878 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
879 |
- push(@constant_values,"domain=$domain") if $domain = $self->domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
880 |
- push(@constant_values,"path=$path") if $path = $self->path; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
881 |
- push(@constant_values,"expires=$expires") if $expires = $self->expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
882 |
- push(@constant_values,"max-age=$max_age") if $max_age = $self->max_age; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
883 |
- push(@constant_values,"secure") if $secure = $self->secure; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
884 |
- push(@constant_values,"HttpOnly") if $httponly = $self->httponly; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
885 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
886 |
- my($key) = escape($self->name); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
887 |
- my($cookie) = join("=",(defined $key ? $key : ''),join("&",map escape(defined $_ ? $_ : ''),$self->value)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
888 |
- return join("; ",$cookie,@constant_values); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
889 |
+ return join "; ", @cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
890 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
891 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
892 |
sub compare { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
893 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
894 |
- my $value = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
895 |
+ my ( $self, $value ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
896 |
return "$self" cmp $value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
897 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
898 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
899 |
@@ -194,6 +178,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
900 |
if ($r) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
901 |
$r->headers_out->add('Set-Cookie' => $self->as_string); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
902 |
} else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
903 |
+ require CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
904 |
print CGI::header(-cookie => $self); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
905 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
906 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
907 |
@@ -201,70 +186,56 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
908 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
909 |
# accessors |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
910 |
sub name { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
911 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
912 |
- my $name = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
913 |
+ my ( $self, $name ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
914 |
$self->{'name'} = $name if defined $name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
915 |
return $self->{'name'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
916 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
917 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
918 |
sub value { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
919 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
920 |
- my $value = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
921 |
- if (defined $value) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
922 |
- my @values; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
923 |
- if (ref($value)) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
924 |
- if (ref($value) eq 'ARRAY') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
925 |
- @values = @$value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
926 |
- } elsif (ref($value) eq 'HASH') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
927 |
- @values = %$value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
928 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
929 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
930 |
- @values = ($value); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
931 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
932 |
- $self->{'value'} = [@values]; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
933 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
934 |
- return wantarray ? @{$self->{'value'}} : $self->{'value'}->[0] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
935 |
+ my ( $self, $value ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
936 |
+ if ( defined $value ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
937 |
+ my @values |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
938 |
+ = ref $value eq 'ARRAY' ? @$value |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
939 |
+ : ref $value eq 'HASH' ? %$value |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
940 |
+ : ( $value ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
941 |
+ $self->{'value'} = [@values]; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
942 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
943 |
+ return wantarray ? @{ $self->{'value'} } : $self->{'value'}->[0]; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
944 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
945 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
946 |
sub domain { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
947 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
948 |
- my $domain = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
949 |
+ my ( $self, $domain ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
950 |
$self->{'domain'} = lc $domain if defined $domain; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
951 |
return $self->{'domain'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
952 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
953 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
954 |
sub secure { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
955 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
956 |
- my $secure = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
957 |
+ my ( $self, $secure ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
958 |
$self->{'secure'} = $secure if defined $secure; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
959 |
return $self->{'secure'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
960 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
961 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
962 |
sub expires { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
963 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
964 |
- my $expires = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
965 |
+ my ( $self, $expires ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
966 |
$self->{'expires'} = CGI::Util::expires($expires,'cookie') if defined $expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
967 |
return $self->{'expires'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
968 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
969 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
970 |
sub max_age { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
971 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
972 |
- my $expires = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
973 |
- $self->{'max-age'} = CGI::Util::expire_calc($expires)-time() if defined $expires; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
974 |
- return $self->{'max-age'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
975 |
+ my ( $self, $max_age ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
976 |
+ $self->{'max-age'} = CGI::Util::expire_calc($max_age)-time() if defined $max_age; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
977 |
+ return $self->{'max-age'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
978 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
979 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
980 |
sub path { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
981 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
982 |
- my $path = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
983 |
+ my ( $self, $path ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
984 |
$self->{'path'} = $path if defined $path; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
985 |
return $self->{'path'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
986 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
987 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
988 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
989 |
sub httponly { # HttpOnly |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
990 |
- my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
991 |
- my $httponly = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
992 |
+ my ( $self, $httponly ) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
993 |
$self->{'httponly'} = $httponly if defined $httponly; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
994 |
return $self->{'httponly'}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
995 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
996 |
@@ -273,7 +244,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
997 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
998 |
=head1 NAME |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
999 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1000 |
-CGI::Cookie - Interface to Netscape Cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1001 |
+CGI::Cookie - Interface to HTTP Cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1002 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1003 |
=head1 SYNOPSIS |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1004 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1005 |
@@ -281,23 +252,23 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1006 |
use CGI::Cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1007 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1008 |
# Create new cookies and send them |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1009 |
- $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1010 |
- $cookie2 = new CGI::Cookie(-name=>'preferences', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1011 |
+ $cookie1 = CGI::Cookie->new(-name=>'ID',-value=>123456); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1012 |
+ $cookie2 = CGI::Cookie->new(-name=>'preferences', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1013 |
-value=>{ font => Helvetica, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1014 |
size => 12 } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1015 |
); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1016 |
print header(-cookie=>[$cookie1,$cookie2]); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1017 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1018 |
# fetch existing cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1019 |
- %cookies = fetch CGI::Cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1020 |
+ %cookies = CGI::Cookie->fetch; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1021 |
$id = $cookies{'ID'}->value; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1022 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1023 |
# create cookies returned from an external source |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1024 |
- %cookies = parse CGI::Cookie($ENV{COOKIE}); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1025 |
+ %cookies = CGI::Cookie->parse($ENV{COOKIE}); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1026 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1027 |
=head1 DESCRIPTION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1028 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1029 |
-CGI::Cookie is an interface to Netscape (HTTP/1.1) cookies, an |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1030 |
+CGI::Cookie is an interface to HTTP/1.1 cookies, an |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1031 |
innovation that allows Web servers to store persistent information on |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1032 |
the browser's side of the connection. Although CGI::Cookie is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1033 |
intended to be used in conjunction with CGI.pm (and is in fact used by |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1034 |
@@ -305,7 +276,9 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1035 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1036 |
For full information on cookies see |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1037 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1038 |
- http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1039 |
+ http://tools.ietf.org/html/rfc2109 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1040 |
+ http://tools.ietf.org/html/rfc2965 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1041 |
+ http://tools.ietf.org/html/draft-ietf-httpstate-cookie |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1042 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1043 |
=head1 USING CGI::Cookie |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1044 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1045 |
@@ -332,7 +305,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1046 |
This is a partial or complete domain name for which the cookie is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1047 |
valid. The browser will return the cookie to any host that matches |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1048 |
the partial domain name. For example, if you specify a domain name |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1049 |
-of ".capricorn.com", then Netscape will return the cookie to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1050 |
+of ".capricorn.com", then the browser will return the cookie to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1051 |
Web servers running on any of the machines "www.capricorn.com", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1052 |
"ftp.capricorn.com", "feckless.capricorn.com", etc. Domain names |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1053 |
must contain at least two periods to prevent attempts to match |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1054 |
@@ -355,24 +328,25 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1055 |
If the "secure" attribute is set, the cookie will only be sent to your |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1056 |
script if the CGI request is occurring on a secure channel, such as SSL. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1057 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1058 |
-=item B<4. httponly flag> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1059 |
+=item B<5. httponly flag> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1060 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1061 |
If the "httponly" attribute is set, the cookie will only be accessible |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1062 |
through HTTP Requests. This cookie will be inaccessible via JavaScript |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1063 |
(to prevent XSS attacks). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1064 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1065 |
-But, currently this feature only used and recognised by |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1066 |
-MS Internet Explorer 6 Service Pack 1 and later. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1067 |
+This feature is only supported by recent browsers like Internet Explorer |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1068 |
+6 Service Pack 1, Firefox 3.0 and Opera 9.5 (and later of course). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1069 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1070 |
-See this URL for more information: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1071 |
+See these URLs for more information: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1072 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1073 |
-L<http://msdn.microsoft.com/en-us/library/ms533046%28VS.85%29.aspx> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1074 |
+ http://msdn.microsoft.com/en-us/library/ms533046.aspx |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1075 |
+ http://www.owasp.org/index.php/HTTPOnly#Browsers_Supporting_HTTPOnly |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1076 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1077 |
=back |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1078 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1079 |
=head2 Creating New Cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1080 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1081 |
- my $c = new CGI::Cookie(-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1082 |
+ my $c = CGI::Cookie->new(-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1083 |
-value => 'bar', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1084 |
-expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1085 |
-domain => '.capricorn.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1086 |
@@ -390,6 +364,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1087 |
recognized by CGI.pm, for example "+3M" for three months in the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1088 |
future. See CGI.pm's documentation for details. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1089 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1090 |
+B<-max-age> accepts the same data formats as B<< -expires >>, but sets a |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1091 |
+relative value instead of an absolute like B<< -expires >>. This is intended to be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1092 |
+more secure since a clock could be changed to fake an absolute time. In |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1093 |
+practice, as of 2011, C<< -max-age >> still does not enjoy the widespread support |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1094 |
+that C<< -expires >> has. You can set both, and browsers that support |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1095 |
+C<< -max-age >> should ignore the C<< Expires >> header. The drawback |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1096 |
+to this approach is the bit of bandwidth for sending an extra header on each cookie. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1097 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1098 |
B<-domain> points to a domain name or to a fully qualified host name. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1099 |
If not specified, the cookie will be returned only to the Web server |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1100 |
that created it. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1101 |
@@ -409,7 +391,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1102 |
a mod_perl request object as the first argument to C<new()>. It will |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1103 |
simply be ignored: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1104 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1105 |
- my $c = new CGI::Cookie($r, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1106 |
+ my $c = CGI::Cookie->new($r, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1107 |
-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1108 |
-value => ['bar','baz']); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1109 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1110 |
@@ -420,6 +402,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1111 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1112 |
$c->bake; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1113 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1114 |
+This will print the Set-Cookie HTTP header to STDOUT using CGI.pm. CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1115 |
+will be loaded for this purpose if it is not already. Otherwise CGI.pm is not |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1116 |
+required or used by this module. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1117 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1118 |
Under mod_perl, pass in an Apache request object: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1119 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1120 |
$c->bake($r); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1121 |
@@ -428,7 +414,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1122 |
a cookie to the browser by creating one or more Set-Cookie: fields in the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1123 |
HTTP header. Here is a typical sequence: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1124 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1125 |
- my $c = new CGI::Cookie(-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1126 |
+ my $c = CGI::Cookie->new(-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1127 |
-value => ['bar','baz'], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1128 |
-expires => '+3M'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1129 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1130 |
@@ -456,14 +442,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1131 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1132 |
=head2 Recovering Previous Cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1133 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1134 |
- %cookies = fetch CGI::Cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1135 |
+ %cookies = CGI::Cookie->fetch; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1136 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1137 |
B<fetch> returns an associative array consisting of all cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1138 |
returned by the browser. The keys of the array are the cookie names. You |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1139 |
can iterate through the cookies this way: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1140 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1141 |
- %cookies = fetch CGI::Cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1142 |
- foreach (keys %cookies) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1143 |
+ %cookies = CGI::Cookie->fetch; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1144 |
+ for (keys %cookies) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1145 |
do_something($cookies{$_}); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1146 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1147 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1148 |
@@ -479,13 +465,16 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1149 |
form using the parse() class method: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1150 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1151 |
$COOKIES = `cat /usr/tmp/Cookie_stash`; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1152 |
- %cookies = parse CGI::Cookie($COOKIES); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1153 |
+ %cookies = CGI::Cookie->parse($COOKIES); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1154 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1155 |
If you are in a mod_perl environment, you can save some overhead by |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1156 |
passing the request object to fetch() like this: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1157 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1158 |
CGI::Cookie->fetch($r); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1159 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1160 |
+If the value passed to parse() is undefined, an empty array will returned in list |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1161 |
+contact, and an empty hashref will be returned in scalar context. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1162 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1163 |
=head2 Manipulating Cookies |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1164 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1165 |
Cookie objects have a series of accessor methods to get and set cookie |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1166 |
@@ -546,4 +535,6 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1167 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1168 |
L<CGI::Carp>, L<CGI> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1169 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1170 |
+L<RFC 2109|http://www.ietf.org/rfc/rfc2109.txt>, L<RFC 2695|http://www.ietf.org/rfc/rfc2965.txt> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1171 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1172 |
=cut |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1173 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Fast.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Fast.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1174 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Fast.pm 2011-06-01 00:47:46.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1175 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Fast.pm 2011-11-09 07:49:15.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1176 |
@@ -19,7 +19,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1177 |
# wish, but if you redistribute a modified version, please attach a note |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1178 |
# listing the modifications you have made. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1179 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1180 |
-$CGI::Fast::VERSION='1.08'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1181 |
+$CGI::Fast::VERSION='1.09'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1182 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1183 |
use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1184 |
use FCGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1185 |
@@ -43,27 +43,23 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1186 |
# in this package variable. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1187 |
use vars qw($Ext_Request); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1188 |
BEGIN { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1189 |
- # If ENV{FCGI_SOCKET_PATH} is given, explicitly open the socket, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1190 |
- # and keep the request handle around from which to call Accept(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1191 |
- if ($ENV{FCGI_SOCKET_PATH}) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1192 |
- my $path = $ENV{FCGI_SOCKET_PATH}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1193 |
- my $backlog = $ENV{FCGI_LISTEN_QUEUE} || 100; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1194 |
- my $socket = FCGI::OpenSocket( $path, $backlog ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1195 |
- $Ext_Request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1196 |
- \%ENV, $socket, 1 ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1197 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1198 |
+ # If ENV{FCGI_SOCKET_PATH} is given, explicitly open the socket. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1199 |
+ if ($ENV{FCGI_SOCKET_PATH}) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1200 |
+ my $path = $ENV{FCGI_SOCKET_PATH}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1201 |
+ my $backlog = $ENV{FCGI_LISTEN_QUEUE} || 100; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1202 |
+ my $socket = FCGI::OpenSocket( $path, $backlog ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1203 |
+ $Ext_Request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1204 |
+ \%ENV, $socket, 1 ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1205 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1206 |
+ else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1207 |
+ $Ext_Request = FCGI::Request(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1208 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1209 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1210 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1211 |
-# New is slightly different in that it calls FCGI's |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1212 |
-# accept() method. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1213 |
sub new { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1214 |
my ($self, $initializer, @param) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1215 |
unless (defined $initializer) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1216 |
- if ($Ext_Request) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1217 |
- return undef unless $Ext_Request->Accept() >= 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1218 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1219 |
- return undef unless FCGI::accept() >= 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1220 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1221 |
+ return undef unless $Ext_Request->Accept() >= 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1222 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1223 |
CGI->_reset_globals; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1224 |
$self->_setup_symbols(@CGI::SAVED_SYMBOLS) if @CGI::SAVED_SYMBOLS; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1225 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Pretty.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Pretty.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1226 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Pretty.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1227 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Pretty.pm 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1228 |
@@ -252,7 +252,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1229 |
=head2 Recommendation for when to use CGI::Pretty |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1230 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1231 |
CGI::Pretty is far slower than using CGI.pm directly. A benchmark showed that |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1232 |
-it could be about 10 times slower. Adding newslines and spaces may alter the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1233 |
+it could be about 10 times slower. Adding newlines and spaces may alter the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1234 |
rendered appearance of HTML. Also, the extra newlines and spaces also make the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1235 |
file size larger, making the files take longer to download. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1236 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1237 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Push.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Push.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1238 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Push.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1239 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Push.pm 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1240 |
@@ -16,7 +16,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1241 |
# The most recent version and complete docs are available at: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1242 |
# http://stein.cshl.org/WWW/software/CGI/ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1243 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1244 |
-$CGI::Push::VERSION='1.04'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1245 |
+$CGI::Push::VERSION='1.05'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1246 |
use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1247 |
use CGI::Util 'rearrange'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1248 |
@ISA = ('CGI'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1249 |
@@ -214,7 +214,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1250 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1251 |
This optional parameter indicates the content type of each page. It |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1252 |
defaults to "text/html". Normally the module assumes that each page |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1253 |
-is of a homogenous MIME type. However if you provide either of the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1254 |
+is of a homogeneous MIME type. However if you provide either of the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1255 |
magic values "heterogeneous" or "dynamic" (the latter provided for the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1256 |
convenience of those who hate long parameter names), you can specify |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1257 |
the MIME type -- and other header fields -- on a per-page basis. See |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1258 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI/Util.pm CGI.pm-3.59/cpan/CGI/lib/CGI/Util.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1259 |
--- perl-5.12.4/cpan/CGI/lib/CGI/Util.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1260 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI/Util.pm 2011-04-28 07:34:54.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1261 |
@@ -1,17 +1,17 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1262 |
package CGI::Util; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1263 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1264 |
+require 5.008001; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1265 |
use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1266 |
-use vars qw($VERSION @EXPORT_OK @ISA $EBCDIC @A2E @E2A); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1267 |
require Exporter; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1268 |
-@ISA = qw(Exporter); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1269 |
-@EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1270 |
+our @ISA = qw(Exporter); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1271 |
+our @EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1272 |
expires ebcdic2ascii ascii2ebcdic); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1273 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1274 |
-$VERSION = '3.48'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1275 |
+our $VERSION = '3.53'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1276 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1277 |
+use constant EBCDIC => "\t" ne "\011"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1278 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1279 |
-$EBCDIC = "\t" ne "\011"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1280 |
# (ord('^') == 95) for codepage 1047 as on os390, vmesa |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1281 |
-@A2E = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1282 |
+our @A2E = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1283 |
0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 21, 11, 12, 13, 14, 15, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1284 |
16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1285 |
64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1286 |
@@ -29,7 +29,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1287 |
68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1288 |
140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1289 |
); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1290 |
-@E2A = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1291 |
+our @E2A = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1292 |
0, 1, 2, 3,156, 9,134,127,151,141,142, 11, 12, 13, 14, 15, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1293 |
16, 17, 18, 19,157, 10, 8,135, 24, 25,146,143, 28, 29, 30, 31, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1294 |
128,129,130,131,132,133, 23, 27,136,137,138,139,140, 5, 6, 7, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1295 |
@@ -48,7 +48,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1296 |
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,179,219,220,217,218,159 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1297 |
); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1298 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1299 |
-if ($EBCDIC && ord('^') == 106) { # as in the BS2000 posix-bc coded character set |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1300 |
+if (EBCDIC && ord('^') == 106) { # as in the BS2000 posix-bc coded character set |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1301 |
$A2E[91] = 187; $A2E[92] = 188; $A2E[94] = 106; $A2E[96] = 74; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1302 |
$A2E[123] = 251; $A2E[125] = 253; $A2E[126] = 255; $A2E[159] = 95; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1303 |
$A2E[162] = 176; $A2E[166] = 208; $A2E[168] = 121; $A2E[172] = 186; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1304 |
@@ -61,7 +61,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1305 |
$E2A[221] = 219; $E2A[224] = 217; $E2A[251] = 123; $E2A[253] = 125; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1306 |
$E2A[255] = 126; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1307 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1308 |
-elsif ($EBCDIC && ord('^') == 176) { # as in codepage 037 on os400 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1309 |
+elsif (EBCDIC && ord('^') == 176) { # as in codepage 037 on os400 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1310 |
$A2E[10] = 37; $A2E[91] = 186; $A2E[93] = 187; $A2E[94] = 176; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1311 |
$A2E[133] = 21; $A2E[168] = 189; $A2E[172] = 95; $A2E[221] = 173; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1312 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1313 |
@@ -161,47 +161,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1314 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1315 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1316 |
sub utf8_chr { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1317 |
- my $c = shift(@_); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1318 |
- if ($] >= 5.006){ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1319 |
- require utf8; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1320 |
- my $u = chr($c); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1321 |
- utf8::encode($u); # drop utf8 flag |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1322 |
- return $u; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1323 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1324 |
- if ($c < 0x80) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1325 |
- return sprintf("%c", $c); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1326 |
- } elsif ($c < 0x800) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1327 |
- return sprintf("%c%c", 0xc0 | ($c >> 6), 0x80 | ($c & 0x3f)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1328 |
- } elsif ($c < 0x10000) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1329 |
- return sprintf("%c%c%c", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1330 |
- 0xe0 | ($c >> 12), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1331 |
- 0x80 | (($c >> 6) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1332 |
- 0x80 | ( $c & 0x3f)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1333 |
- } elsif ($c < 0x200000) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1334 |
- return sprintf("%c%c%c%c", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1335 |
- 0xf0 | ($c >> 18), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1336 |
- 0x80 | (($c >> 12) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1337 |
- 0x80 | (($c >> 6) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1338 |
- 0x80 | ( $c & 0x3f)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1339 |
- } elsif ($c < 0x4000000) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1340 |
- return sprintf("%c%c%c%c%c", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1341 |
- 0xf8 | ($c >> 24), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1342 |
- 0x80 | (($c >> 18) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1343 |
- 0x80 | (($c >> 12) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1344 |
- 0x80 | (($c >> 6) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1345 |
- 0x80 | ( $c & 0x3f)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1346 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1347 |
- } elsif ($c < 0x80000000) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1348 |
- return sprintf("%c%c%c%c%c%c", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1349 |
- 0xfc | ($c >> 30), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1350 |
- 0x80 | (($c >> 24) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1351 |
- 0x80 | (($c >> 18) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1352 |
- 0x80 | (($c >> 12) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1353 |
- 0x80 | (($c >> 6) & 0x3f), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1354 |
- 0x80 | ( $c & 0x3f)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1355 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1356 |
- return utf8_chr(0xfffd); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1357 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1358 |
+ my $c = shift(@_); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1359 |
+ my $u = chr($c); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1360 |
+ utf8::encode($u); # drop utf8 flag |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1361 |
+ return $u; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1362 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1363 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1364 |
# unescape URL-encoded data |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1365 |
@@ -210,10 +173,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1366 |
my $todecode = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1367 |
return undef unless defined($todecode); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1368 |
$todecode =~ tr/+/ /; # pluses become spaces |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1369 |
- if ($EBCDIC) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1370 |
+ if (EBCDIC) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1371 |
$todecode =~ s/%([0-9a-fA-F]{2})/chr $A2E[hex($1)]/ge; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1372 |
} else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1373 |
- # handle surrogate pairs first -- dankogai |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1374 |
+ # handle surrogate pairs first -- dankogai. Ref: http://unicode.org/faq/utf_bom.html#utf16-2 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1375 |
$todecode =~ s{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1376 |
%u([Dd][89a-bA-B][0-9a-fA-F]{2}) # hi |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1377 |
%u([Dd][c-fC-F][0-9a-fA-F]{2}) # lo |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1378 |
@@ -235,7 +198,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1379 |
# We cannot use the %u escapes, they were rejected by W3C, so the official |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1380 |
# way is %XX-escaped utf-8 encoding. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1381 |
# Naturally, Unicode strings have to be converted to their utf-8 byte |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1382 |
-# representation. (No action is required on 5.6.) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1383 |
+# representation. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1384 |
# Byte strings were traditionally used directly as a sequence of octets. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1385 |
# This worked if they actually represented binary data (i.e. in CGI::Compress). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1386 |
# This also worked if these byte strings were actually utf-8 encoded; e.g., |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1387 |
@@ -244,39 +207,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1388 |
# was always so and cannot be fixed without breaking the binary data case. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1389 |
# -- Stepan Kasal <[email protected]> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1390 |
# |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1391 |
-if ($] == 5.008) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1392 |
- package utf8; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1393 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1394 |
- no warnings 'redefine'; # needed for Perl 5.8.1+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1395 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1396 |
- my $is_utf8_redefinition = <<'EOR'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1397 |
- sub is_utf8 { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1398 |
- my ($text) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1399 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1400 |
- my $ctext = pack q{C0a*}, $text; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1401 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1402 |
- return ($text ne $ctext) && ($ctext =~ m/^( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1403 |
- [\x09\x0A\x0D\x20-\x7E] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1404 |
- | [\xC2-\xDF][\x80-\xBF] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1405 |
- | \xE0[\xA0-\xBF][\x80-\xBF] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1406 |
- | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1407 |
- | \xED[\x80-\x9F][\x80-\xBF] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1408 |
- | \xF0[\x90-\xBF][\x80-\xBF]{2} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1409 |
- | [\xF1-\xF3][\x80-\xBF]{3} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1410 |
- | \xF4[\x80-\x8F][\x80-\xBF]{2} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1411 |
- )*$/xo); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1412 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1413 |
-EOR |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1414 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1415 |
- eval $is_utf8_redefinition; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1416 |
-} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1417 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1418 |
sub escape { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1419 |
+ # If we being called in an OO-context, discard the first argument. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1420 |
shift() if @_ > 1 and ( ref($_[0]) || (defined $_[1] && $_[0] eq $CGI::DefaultClass)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1421 |
my $toencode = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1422 |
return undef unless defined($toencode); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1423 |
- utf8::encode($toencode) if ($] >= 5.008 && utf8::is_utf8($toencode)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1424 |
- if ($EBCDIC) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1425 |
+ utf8::encode($toencode) if utf8::is_utf8($toencode); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1426 |
+ if (EBCDIC) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1427 |
$toencode=~s/([^a-zA-Z0-9_.~-])/uc sprintf("%%%02x",$E2A[ord($1)])/eg; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1428 |
} else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1429 |
$toencode=~s/([^a-zA-Z0-9_.~-])/uc sprintf("%%%02x",ord($1))/eg; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1430 |
@@ -340,7 +278,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1431 |
} else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1432 |
return $time; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1433 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1434 |
- return (time+$offset); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1435 |
+ my $cur_time = time; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1436 |
+ return ($cur_time+$offset); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1437 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1438 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1439 |
sub ebcdic2ascii { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1440 |
@@ -373,7 +312,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1441 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1442 |
=head1 AUTHOR INFORMATION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1443 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1444 |
-Copyright 1995-1998, Lincoln D. Stein. All rights reserved. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1445 |
+Copyright 1995-1998, Lincoln D. Stein. All rights reserved. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1446 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1447 |
This library is free software; you can redistribute it and/or modify |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1448 |
it under the same terms as Perl itself. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1449 |
@@ -383,7 +322,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1450 |
Perl, the name and version of your Web server, and the name and |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1451 |
version of the operating system you are using. If the problem is even |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1452 |
remotely browser dependent, please provide information about the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1453 |
-affected browers as well. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1454 |
+affected browsers as well. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1455 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1456 |
=head1 SEE ALSO |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1457 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1458 |
diff -Naur perl-5.12.4/cpan/CGI/lib/CGI.pm CGI.pm-3.59/cpan/CGI/lib/CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1459 |
--- perl-5.12.4/cpan/CGI/lib/CGI.pm 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1460 |
+++ CGI.pm-3.59/cpan/CGI/lib/CGI.pm 2011-12-30 05:31:41.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1461 |
@@ -1,5 +1,5 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1462 |
package CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1463 |
-require 5.004; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1464 |
+require 5.008001; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1465 |
use Carp 'croak'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1466 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1467 |
# See the bottom of this file for the POD documentation. Search for the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1468 |
@@ -16,10 +16,11 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1469 |
# listing the modifications you have made. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1470 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1471 |
# The most recent version and complete docs are available at: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1472 |
-# http://stein.cshl.org/WWW/software/CGI/ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1473 |
+# http://search.cpan.org/dist/CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1474 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1475 |
+# The revision is no longer being updated since moving to git. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1476 |
$CGI::revision = '$Id: CGI.pm,v 1.266 2009/07/30 16:32:34 lstein Exp $'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1477 |
-$CGI::VERSION='3.49'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1478 |
+$CGI::VERSION='3.59'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1479 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1480 |
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1481 |
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1482 |
@@ -385,7 +386,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1483 |
# user is still holding any reference to them as well. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1484 |
sub DESTROY { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1485 |
my $self = shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1486 |
- if ($OS eq 'WINDOWS') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1487 |
+ if ($OS eq 'WINDOWS' || $OS eq 'VMS') { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1488 |
for my $href (values %{$self->{'.tmpfiles'}}) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1489 |
$href->{hndl}->DESTROY if defined $href->{hndl}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1490 |
$href->{name}->DESTROY if defined $href->{name}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1491 |
@@ -524,7 +525,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1492 |
# if we get called more than once, we want to initialize |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1493 |
# ourselves from the original query (which may be gone |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1494 |
# if it was read from STDIN originally.) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1495 |
- if (defined(@QUERY_PARAM) && !defined($initializer)) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1496 |
+ if (@QUERY_PARAM && !defined($initializer)) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1497 |
for my $name (@QUERY_PARAM) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1498 |
my $val = $QUERY_PARAM{$name}; # always an arrayref; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1499 |
$self->param('-name'=>$name,'-value'=> $val); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1500 |
@@ -647,9 +648,9 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1501 |
last METHOD; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1502 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1503 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1504 |
- # If method is GET or HEAD, fetch the query from |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1505 |
+ # If method is GET, HEAD or DELETE, fetch the query from |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1506 |
# the environment. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1507 |
- if ($is_xforms || $meth=~/^(GET|HEAD)$/) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1508 |
+ if ($is_xforms || $meth=~/^(GET|HEAD|DELETE)$/) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1509 |
if ($MOD_PERL) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1510 |
$query_string = $self->r->args; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1511 |
} else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1512 |
@@ -663,14 +664,6 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1513 |
if ( $content_length > 0 ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1514 |
$self->read_from_client(\$query_string,$content_length,0); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1515 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1516 |
- elsif (not defined $ENV{CONTENT_LENGTH}) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1517 |
- $self->read_from_stdin(\$query_string); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1518 |
- # should this be PUTDATA in case of PUT ? |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1519 |
- my($param) = $meth . 'DATA' ; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1520 |
- $self->add_parameter($param) ; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1521 |
- push (@{$self->{param}{$param}},$query_string); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1522 |
- undef $query_string ; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1523 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1524 |
# Some people want to have their cake and eat it too! |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1525 |
# Uncomment this line to have the contents of the query string |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1526 |
# APPENDED to the POST data. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1527 |
@@ -1023,47 +1016,6 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1528 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1529 |
END_OF_FUNC |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1530 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1531 |
-'read_from_stdin' => <<'END_OF_FUNC', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1532 |
-# Read data from stdin until all is read |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1533 |
-sub read_from_stdin { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1534 |
- my($self, $buff) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1535 |
- local $^W=0; # prevent a warning |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1536 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1537 |
- # |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1538 |
- # TODO: loop over STDIN until all is read |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1539 |
- # |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1540 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1541 |
- my($eoffound) = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1542 |
- my($localbuf) = ''; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1543 |
- my($tempbuf) = ''; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1544 |
- my($bufsiz) = 1024; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1545 |
- my($res); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1546 |
- while ($eoffound == 0) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1547 |
- if ( $MOD_PERL ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1548 |
- $res = $self->r->read($tempbuf, $bufsiz, 0) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1549 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1550 |
- else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1551 |
- $res = read(\*STDIN, $tempbuf, $bufsiz); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1552 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1553 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1554 |
- if ( !defined($res) ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1555 |
- # TODO: how to do error reporting ? |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1556 |
- $eoffound = 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1557 |
- last; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1558 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1559 |
- if ( $res == 0 ) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1560 |
- $eoffound = 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1561 |
- last; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1562 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1563 |
- $localbuf .= $tempbuf; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1564 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1565 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1566 |
- $$buff = $localbuf; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1567 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1568 |
- return $res; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1569 |
-} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1570 |
-END_OF_FUNC |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1571 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1572 |
'delete' => <<'END_OF_FUNC', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1573 |
#### Method: delete |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1574 |
# Deletes the named parameter entirely. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1575 |
@@ -1570,12 +1522,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1576 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1577 |
$type ||= 'text/html' unless defined($type); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1578 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1579 |
- if (defined $charset) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1580 |
- $self->charset($charset); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1581 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1582 |
- $charset = $self->charset if $type =~ /^text\//; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1583 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1584 |
- $charset ||= ''; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1585 |
+ # sets if $charset is given, gets if not |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1586 |
+ $charset = $self->charset( $charset ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1587 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1588 |
# rearrange() was designed for the HTML portion, so we |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1589 |
# need to fix it up a little. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1590 |
@@ -1629,7 +1577,6 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1591 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1592 |
END_OF_FUNC |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1593 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1594 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1595 |
#### Method: cache |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1596 |
# Control whether header() will produce the no-cache |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1597 |
# Pragma directive. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1598 |
@@ -1861,20 +1808,20 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1599 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1600 |
my (@scripts) = ref($script) eq 'ARRAY' ? @$script : ($script); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1601 |
for $script (@scripts) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1602 |
- my($src,$code,$language); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1603 |
- if (ref($script)) { # script is a hash |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1604 |
- ($src,$code,$type) = |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1605 |
- rearrange(['SRC','CODE',['LANGUAGE','TYPE']], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1606 |
- '-foo'=>'bar', # a trick to allow the '-' to be omitted |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1607 |
- ref($script) eq 'ARRAY' ? @$script : %$script); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1608 |
+ my($src,$code,$language,$charset); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1609 |
+ if (ref($script)) { # script is a hash |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1610 |
+ ($src,$code,$type,$charset) = |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1611 |
+ rearrange(['SRC','CODE',['LANGUAGE','TYPE'],'CHARSET'], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1612 |
+ '-foo'=>'bar', # a trick to allow the '-' to be omitted |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1613 |
+ ref($script) eq 'ARRAY' ? @$script : %$script); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1614 |
$type ||= 'text/javascript'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1615 |
unless ($type =~ m!\w+/\w+!) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1616 |
$type =~ s/[\d.]+$//; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1617 |
$type = "text/$type"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1618 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1619 |
- } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1620 |
- ($src,$code,$type) = ('',$script, 'text/javascript'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1621 |
- } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1622 |
+ } else { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1623 |
+ ($src,$code,$type,$charset) = ('',$script, 'text/javascript', ''); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1624 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1625 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1626 |
my $comment = '//'; # javascript by default |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1627 |
$comment = '#' if $type=~/perl|tcl/i; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1628 |
@@ -1892,6 +1839,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1629 |
my(@satts); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1630 |
push(@satts,'src'=>$src) if $src; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1631 |
push(@satts,'type'=>$type); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1632 |
+ push(@satts,'charset'=>$charset) if ($src && $charset); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1633 |
$code = $cdata_start . $code . $cdata_end if defined $code; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1634 |
push(@result,$self->script({@satts},$code || '')); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1635 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1636 |
@@ -2859,7 +2807,6 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1637 |
my $query_str = $self->query_string; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1638 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1639 |
my $rewrite_in_use = $request_uri && $request_uri !~ /^\Q$script_name/; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1640 |
- undef $path if $rewrite_in_use && $rewrite; # path not valid when rewriting active |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1641 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1642 |
my $uri = $rewrite && $request_uri ? $request_uri : $script_name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1643 |
$uri =~ s/\?.*$//s; # remove query string |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1644 |
@@ -2961,6 +2908,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1645 |
sub param_fetch { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1646 |
my($self,@p) = self_or_default(@_); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1647 |
my($name) = rearrange([NAME],@p); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1648 |
+ return [] unless defined $name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1649 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1650 |
unless (exists($self->{param}{$name})) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1651 |
$self->add_parameter($name); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1652 |
$self->{param}{$name} = []; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1653 |
@@ -3532,11 +3481,11 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1654 |
if ($DEBUG && @ARGV) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1655 |
@words = @ARGV; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1656 |
} elsif ($DEBUG > 1) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1657 |
- require "shellwords.pl"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1658 |
+ require Text::ParseWords; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1659 |
print STDERR "(offline mode: enter name=value pairs on standard input; press ^D or ^Z when done)\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1660 |
chomp(@lines = <STDIN>); # remove newlines |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1661 |
$input = join(" ",@lines); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1662 |
- @words = &shellwords($input); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1663 |
+ @words = &Text::ParseWords::old_shellwords($input); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1664 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1665 |
for (@words) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1666 |
s/\\=/%3D/g; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1667 |
@@ -3636,7 +3585,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1668 |
last if defined($filehandle = Fh->new($filename,$tmp,$PRIVATE_TEMPFILES)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1669 |
$seqno += int rand(100); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1670 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1671 |
- die "CGI open of tmpfile: $!\n" unless defined $filehandle; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1672 |
+ die "CGI.pm open of tmpfile $tmp/$filename failed: $!\n" unless defined $filehandle; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1673 |
$CGI::DefaultClass->binmode($filehandle) if $CGI::needs_binmode |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1674 |
&& defined fileno($filehandle); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1675 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1676 |
@@ -4271,7 +4220,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1677 |
sub new { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1678 |
my($package,$sequence) = @_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1679 |
my $filename; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1680 |
- find_tempdir() unless -w $TMPDIRECTORY; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1681 |
+ unless (-w $TMPDIRECTORY) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1682 |
+ $TMPDIRECTORY = undef; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1683 |
+ find_tempdir(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1684 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1685 |
for (my $i = 0; $i < $MAXTRIES; $i++) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1686 |
last if ! -f ($filename = sprintf("\%s${SL}CGItemp%d", $TMPDIRECTORY, $sequence++)); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1687 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1688 |
@@ -4522,7 +4474,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1689 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1690 |
$query = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1691 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1692 |
-This will parse the input (from both POST and GET methods) and store |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1693 |
+This will parse the input (from POST, GET and DELETE methods) and store |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1694 |
it into a perl5 object called $query. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1695 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1696 |
Any filehandles from file uploads will have their position reset to |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1697 |
@@ -4721,9 +4673,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1698 |
unshift @{$q->param_fetch(-name=>'address')},'George Munster'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1699 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1700 |
If you need access to the parameter list in a way that isn't covered |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1701 |
-by the methods above, you can obtain a direct reference to it by |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1702 |
-calling the B<param_fetch()> method with the name of the . This |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1703 |
-will return an array reference to the named parameters, which you then |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1704 |
+by the methods given in the previous sections, you can obtain a direct |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1705 |
+reference to it by |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1706 |
+calling the B<param_fetch()> method with the name of the parameter. This |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1707 |
+will return an array reference to the named parameter, which you then |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1708 |
can manipulate in any way you like. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1709 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1710 |
You can also use a named argument style using the B<-name> argument. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1711 |
@@ -5128,8 +5081,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1712 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1713 |
The temporary directory is selected using the following algorithm: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1714 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1715 |
- 1. if the current user (e.g. "nobody") has a directory named |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1716 |
- "tmp" in its home directory, use that (Unix systems only). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1717 |
+ 1. if $CGITempFile::TMPDIRECTORY is already set, use that |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1718 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1719 |
2. if the environment variable TMPDIR exists, use the location |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1720 |
indicated. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1721 |
@@ -5291,17 +5243,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1722 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1723 |
P3P: policyref="/w3c/p3p.xml" cp="CAO DSP LAW CURa" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1724 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1725 |
-Note that if a header value contains a carriage return, a leading space will be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1726 |
-added to each new line that doesn't already have one as specified by RFC2616 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1727 |
-section 4.2. For example: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1728 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1729 |
- print header( -ingredients => "ham\neggs\nbacon" ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1730 |
+CGI.pm will accept valid multi-line headers when each line is separated with a |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1731 |
+CRLF value ("\r\n" on most platforms) followed by at least one space. For example: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1732 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1733 |
-will generate |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1734 |
+ print header( -ingredients => "ham\r\n\seggs\r\n\sbacon" ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1735 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1736 |
- Ingredients: ham |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1737 |
- eggs |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1738 |
- bacon |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1739 |
+Invalid multi-line header input will trigger in an exception. When multi-line headers |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1740 |
+are received, CGI.pm will always output them back as a single line, according to the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1741 |
+folding rules of RFC 2616: the newlines will be removed, while the white space remains. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1742 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1743 |
=head2 GENERATING A REDIRECTION HEADER |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1744 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1745 |
@@ -5357,8 +5306,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1746 |
-style=>{'src'=>'/styles/style1.css'}, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1747 |
-BGCOLOR=>'blue'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1748 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1749 |
-After creating the HTTP header, most CGI scripts will start writing |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1750 |
-out an HTML document. The start_html() routine creates the top of the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1751 |
+The start_html() routine creates the top of the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1752 |
page, along with a lot of optional information that controls the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1753 |
page's appearance and behavior. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1754 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1755 |
@@ -5412,6 +5360,18 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1756 |
The B<-encoding> argument can be used to specify the character set for |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1757 |
XHTML. It defaults to iso-8859-1 if not specified. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1758 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1759 |
+The B<-dtd> argument can be used to specify a public DTD identifier string. For example: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1760 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1761 |
+ -dtd => '-//W3C//DTD HTML 4.01 Transitional//EN') |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1762 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1763 |
+Alternatively, it can take public and system DTD identifiers as an array: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1764 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1765 |
+ dtd => [ '-//W3C//DTD HTML 4.01 Transitional//EN', 'http://www.w3.org/TR/html4/loose.dtd' ] |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1766 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1767 |
+For the public DTD identifier to be considered, it must be valid. Otherwise it |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1768 |
+will be replaced by the default DTD. If the public DTD contains 'XHTML', CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1769 |
+will emit XML. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1770 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1771 |
The B<-declare_xml> argument, when used in conjunction with XHTML, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1772 |
will put a <?xml> declaration at the top of the HTML header. The sole |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1773 |
purpose of this declaration is to declare the character set |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1774 |
@@ -5420,11 +5380,11 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1775 |
most validators. The default for -declare_xml is false. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1776 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1777 |
You can place other arbitrary HTML elements to the <head> section with the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1778 |
-B<-head> tag. For example, to place the rarely-used <link> element in the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1779 |
+B<-head> tag. For example, to place a <link> element in the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1780 |
head section, use this: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1781 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1782 |
- print start_html(-head=>Link({-rel=>'next', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1783 |
- -href=>'http://www.capricorn.com/s2.html'})); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1784 |
+ print start_html(-head=>Link({-rel=>'shortcut icon', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1785 |
+ -href=>'favicon.ico'})); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1786 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1787 |
To incorporate multiple HTML elements into the <head> section, just pass an |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1788 |
array reference: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1789 |
@@ -5486,12 +5446,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1790 |
browsers that do not have JavaScript (or browsers where JavaScript is turned |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1791 |
off). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1792 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1793 |
-The <script> tag, has several attributes including "type" and src. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1794 |
-The latter is particularly interesting, as it allows you to keep the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1795 |
-JavaScript code in a file or CGI script rather than cluttering up each |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1796 |
-page with the source. To use these attributes pass a HASH reference |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1797 |
-in the B<-script> parameter containing one or more of -type, -src, or |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1798 |
--code: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1799 |
+The <script> tag, has several attributes including "type", "charset" and "src". |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1800 |
+"src" allows you to keep JavaScript code in an external file. To use these |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1801 |
+attributes pass a HASH reference in the B<-script> parameter containing one or |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1802 |
+more of -type, -src, or -code: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1803 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1804 |
print $q->start_html(-title=>'The Riddle of the Sphinx', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1805 |
-script=>{-type=>'JAVASCRIPT', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1806 |
@@ -5527,7 +5485,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1807 |
); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1808 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1809 |
The option "-language" is a synonym for -type, and is supported for |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1810 |
-backwad compatibility. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1811 |
+backwards compatibility. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1812 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1813 |
The old-style positional parameters are as follows: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1814 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1815 |
@@ -5558,13 +5516,13 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1816 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1817 |
=head2 ENDING THE HTML DOCUMENT: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1818 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1819 |
- print end_html |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1820 |
+ print $q->end_html; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1821 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1822 |
This ends an HTML document by printing the </body></html> tags. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1823 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1824 |
=head2 CREATING A SELF-REFERENCING URL THAT PRESERVES STATE INFORMATION: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1825 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1826 |
- $myself = self_url; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1827 |
+ $myself = $q->self_url; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1828 |
print q(<a href="$myself">I'm talking to myself.</a>); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1829 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1830 |
self_url() will return a URL, that, when selected, will reinvoke |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1831 |
@@ -5573,7 +5531,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1832 |
internal anchors but you don't want to disrupt the current contents |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1833 |
of the form(s). Something like this will do the trick. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1834 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1835 |
- $myself = self_url; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1836 |
+ $myself = $q->self_url; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1837 |
print "<a href=\"$myself#table1\">See table 1</a>"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1838 |
print "<a href=\"$myself#table2\">See table 2</a>"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1839 |
print "<a href=\"$myself#yourself\">See for yourself</a>"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1840 |
@@ -5583,7 +5541,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1841 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1842 |
You can also retrieve the unprocessed query string with query_string(): |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1843 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1844 |
- $the_string = query_string; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1845 |
+ $the_string = $q->query_string(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1846 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1847 |
+The behavior of calling query_string is currently undefined when the HTTP method is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1848 |
+something other than GET. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1849 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1850 |
=head2 OBTAINING THE SCRIPT'S URL |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1851 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1852 |
@@ -5645,9 +5606,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1853 |
info probably won't match the request that the user sent. Set |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1854 |
-rewrite=>1 (default) to return URLs that match what the user sent |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1855 |
(the original request URI). Set -rewrite=>0 to return URLs that match |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1856 |
-the URL after mod_rewrite's rules have run. Because the additional |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1857 |
-path information only makes sense in the context of the rewritten URL, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1858 |
--rewrite is set to false when you request path info in the URL. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1859 |
+the URL after mod_rewrite's rules have run. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1860 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1861 |
=back |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1862 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1863 |
@@ -5672,14 +5631,8 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1864 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1865 |
=head1 CREATING STANDARD HTML ELEMENTS: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1866 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1867 |
-CGI.pm defines general HTML shortcut methods for most, if not all of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1868 |
-the HTML 3 and HTML 4 tags. HTML shortcuts are named after a single |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1869 |
-HTML element and return a fragment of HTML text that you can then |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1870 |
-print or manipulate as you like. Each shortcut returns a fragment of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1871 |
-HTML code that you can append to a string, save to a file, or, most |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1872 |
-commonly, print out so that it displays in the browser window. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1873 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1874 |
-This example shows how to use the HTML methods: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1875 |
+CGI.pm defines general HTML shortcut methods for many HTML tags. HTML shortcuts are named after a single |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1876 |
+HTML element and return a fragment of HTML text. Example: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1877 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1878 |
print $q->blockquote( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1879 |
"Many years ago on the island of", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1880 |
@@ -5935,7 +5888,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1881 |
$query->autoEscape(0); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1882 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1883 |
Note that autoEscape() is exclusively used to effect the behavior of how some |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1884 |
-CGI.pm HTML generation fuctions handle escaping. Calling escapeHTML() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1885 |
+CGI.pm HTML generation functions handle escaping. Calling escapeHTML() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1886 |
explicitly will always escape the HTML. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1887 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1888 |
I<A Lurking Trap!> Some of the form-element generating methods return |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1889 |
@@ -5985,7 +5938,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1890 |
method: POST |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1891 |
action: this script |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1892 |
enctype: application/x-www-form-urlencoded for non-XHTML |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1893 |
- multipart/form-data for XHTML, see mulitpart/form-data below. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1894 |
+ multipart/form-data for XHTML, see multipart/form-data below. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1895 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1896 |
end_form() returns the closing </form> tag. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1897 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1898 |
@@ -6228,7 +6181,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1899 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1900 |
=head3 Basics |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1901 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1902 |
-When the form is processed, you can retrieve an L<IO::Handle> compatibile |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1903 |
+When the form is processed, you can retrieve an L<IO::Handle> compatible |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1904 |
handle for a file upload field like this: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1905 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1906 |
$lightweight_fh = $q->upload('field_name'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1907 |
@@ -6316,7 +6269,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1908 |
CGI.pm gives you low-level access to file upload management through |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1909 |
a file upload hook. You can use this feature to completely turn off |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1910 |
the temp file storage of file uploads, or potentially write your own |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1911 |
-file upload progess meter. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1912 |
+file upload progress meter. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1913 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1914 |
This is much like the UPLOAD_HOOK facility available in L<Apache::Request>, with |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1915 |
the exception that the first argument to the callback is an L<Apache::Upload> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1916 |
@@ -6369,7 +6322,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1917 |
To solve this problem the upload() method was added, which always returns a |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1918 |
lightweight filehandle. This generally works well, but will have trouble |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1919 |
interoperating with some other modules because the file handle is not derived |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1920 |
-from L<IO::Handle>. So that brings us to current recommedation given above, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1921 |
+from L<IO::Handle>. So that brings us to current recommendation given above, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1922 |
which is to call the handle() method on the file handle returned by upload(). |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1923 |
That upgrades the handle to an IO::Handle. It's a big win for compatibility for |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1924 |
a small penalty of loading IO::Handle the first time you call it. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1925 |
@@ -7608,7 +7561,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1926 |
127.0.0.1 if the address is unavailable. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1927 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1928 |
=item B<script_name()> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1929 |
-Return the script name as a partial URL, for self-refering |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1930 |
+Return the script name as a partial URL, for self-referring |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1931 |
scripts. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1932 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1933 |
=item B<referer()> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1934 |
@@ -7725,7 +7678,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1935 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1936 |
=item In the B<use> statement |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1937 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1938 |
-Simply add the "-nph" pragmato the list of symbols to be imported into |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1939 |
+Simply add the "-nph" pragma to the list of symbols to be imported into |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1940 |
your script: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1941 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1942 |
use CGI qw(:standard -nph) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1943 |
@@ -7911,11 +7864,13 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1944 |
compatibility routine "ReadParse" is provided. Porting is simple: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1945 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1946 |
OLD VERSION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1947 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1948 |
require "cgi-lib.pl"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1949 |
&ReadParse; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1950 |
print "The value of the antique is $in{antique}.\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1951 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1952 |
NEW VERSION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1953 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1954 |
use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1955 |
CGI::ReadParse(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1956 |
print "The value of the antique is $in{antique}.\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1957 |
@@ -7923,30 +7878,79 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1958 |
CGI.pm's ReadParse() routine creates a tied variable named %in, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1959 |
which can be accessed to obtain the query variables. Like |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1960 |
ReadParse, you can also provide your own variable. Infrequently |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1961 |
-used features of ReadParse, such as the creation of @in and $in |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1962 |
+used features of ReadParse, such as the creation of @in and $in |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1963 |
variables, are not supported. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1964 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1965 |
Once you use ReadParse, you can retrieve the query object itself |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1966 |
this way: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1967 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1968 |
$q = $in{CGI}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1969 |
- print textfield(-name=>'wow', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1970 |
- -value=>'does this really work?'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1971 |
+ print $q->textfield(-name=>'wow', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1972 |
+ -value=>'does this really work?'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1973 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1974 |
This allows you to start using the more interesting features |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1975 |
of CGI.pm without rewriting your old scripts from scratch. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1976 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1977 |
-=head1 AUTHOR INFORMATION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1978 |
+An even simpler way to mix cgi-lib calls with CGI.pm calls is to import both the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1979 |
+C<:cgi-lib> and C<:standard> method: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1980 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1981 |
+ use CGI qw(:cgi-lib :standard); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1982 |
+ &ReadParse; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1983 |
+ print "The price of your purchase is $in{price}.\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1984 |
+ print textfield(-name=>'price', -default=>'$1.99'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1985 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1986 |
+=head2 Cgi-lib functions that are available in CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1987 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1988 |
+In compatibility mode, the following cgi-lib.pl functions are |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1989 |
+available for your use: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1990 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1991 |
+ ReadParse() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1992 |
+ PrintHeader() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1993 |
+ HtmlTop() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1994 |
+ HtmlBot() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1995 |
+ SplitParam() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1996 |
+ MethGet() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1997 |
+ MethPost() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1998 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1999 |
+=head2 Cgi-lib functions that are not available in CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2000 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2001 |
+ * Extended form of ReadParse() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2002 |
+ The extended form of ReadParse() that provides for file upload |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2003 |
+ spooling, is not available. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2004 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2005 |
+ * MyBaseURL() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2006 |
+ This function is not available. Use CGI.pm's url() method instead. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2007 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2008 |
+ * MyFullURL() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2009 |
+ This function is not available. Use CGI.pm's self_url() method |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2010 |
+ instead. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2011 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2012 |
+ * CgiError(), CgiDie() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2013 |
+ These functions are not supported. Look at CGI::Carp for the way I |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2014 |
+ prefer to handle error messages. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2015 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2016 |
+ * PrintVariables() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2017 |
+ This function is not available. To achieve the same effect, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2018 |
+ just print out the CGI object: |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2019 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2020 |
+ use CGI qw(:standard); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2021 |
+ $q = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2022 |
+ print h1("The Variables Are"),$q; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2023 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2024 |
-The CGI.pm distribution is copyright 1995-2007, Lincoln D. Stein. It is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2025 |
-distributed under GPL and the Artistic License 2.0. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2026 |
+ * PrintEnv() |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2027 |
+ This function is not available. You'll have to roll your own if you really need it. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2028 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2029 |
+=head1 AUTHOR INFORMATION |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2030 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2031 |
-Address bug reports and comments to: [email protected]. When sending |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2032 |
-bug reports, please provide the version of CGI.pm, the version of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2033 |
-Perl, the name and version of your Web server, and the name and |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2034 |
-version of the operating system you are using. If the problem is even |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2035 |
-remotely browser dependent, please provide information about the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2036 |
-affected browers as well. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2037 |
+The CGI.pm distribution is copyright 1995-2007, Lincoln D. Stein. It is |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2038 |
+distributed under GPL and the Artistic License 2.0. It is currently |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2039 |
+maintained by Mark Stosberg with help from many contributors. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2040 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2041 |
+Address bug reports and comments to: https://rt.cpan.org/Public/Dist/Display.html?Queue=CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2042 |
+When sending bug reports, please provide the version of CGI.pm, the version of |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2043 |
+Perl, the name and version of your Web server, and the name and version of the |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2044 |
+operating system you are using. If the problem is even remotely browser |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2045 |
+dependent, please provide information about the affected browsers as well. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2046 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2047 |
=head1 CREDITS |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2048 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2049 |
diff -Naur perl-5.12.4/cpan/CGI/t/carp.t CGI.pm-3.59/cpan/CGI/t/carp.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2050 |
--- perl-5.12.4/cpan/CGI/t/carp.t 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2051 |
+++ CGI.pm-3.59/cpan/CGI/t/carp.t 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2052 |
@@ -1,12 +1,12 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2053 |
# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 2 -*- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2054 |
-#!/usr/local/bin/perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2055 |
+#!perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2056 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2057 |
use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2058 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2059 |
-use Test::More tests => 59; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2060 |
+use Test::More tests => 61; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2061 |
use IO::Handle; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2062 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2063 |
-BEGIN { use_ok('CGI::Carp') }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2064 |
+use CGI::Carp; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2065 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2066 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2067 |
# Test id |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2068 |
@@ -337,9 +337,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2069 |
CGI::Carp::die( My::Stringified::Object->new ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2070 |
$result{string_object} .= $_ while <STDOUT>; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2071 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2072 |
+ undef $@; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2073 |
CGI::Carp::die(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2074 |
$result{no_args} .= $_ while <STDOUT>; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2075 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2076 |
+ $@ = "I think I caught a virus"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2077 |
+ CGI::Carp::die(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2078 |
+ $result{propagated} .= $_ while <STDOUT>; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2079 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2080 |
untie *STDOUT; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2081 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2082 |
like $result{string} => qr/regular string/, 'regular string, wrapped'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2083 |
@@ -352,6 +357,9 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2084 |
'stringified object, wrapped'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2085 |
like $result{no_args} => qr/Died at/, 'no args, wrapped'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2086 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2087 |
+ like $result{propagated} => qr/I think I caught a virus\t\.{3}propagated/, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2088 |
+ 'propagating $@ if no argument'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2089 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2090 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2091 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2092 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2093 |
@@ -371,3 +379,20 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2094 |
return bless {}, shift; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2095 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2096 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2097 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2098 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2099 |
+@result = (); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2100 |
+tie *STDOUT, 'StoreStuff' or die "Can't tie STDOUT"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2101 |
+ { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2102 |
+ eval { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2103 |
+ $CGI::Carp::TO_BROWSER = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2104 |
+ die 'Message ToBrowser = 0'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2105 |
+ }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2106 |
+ $result[0] = $@; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2107 |
+ $result[1] .= $_ while (<STDOUT>); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2108 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2109 |
+untie *STDOUT; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2110 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2111 |
+ like $result[0] => qr/Message ToBrowser/, 'die message for ToBrowser = 0 is OK'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2112 |
+ ok !$result[1], 'No output for ToBrowser = 0'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2113 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2114 |
diff -Naur perl-5.12.4/cpan/CGI/t/charset.t CGI.pm-3.59/cpan/CGI/t/charset.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2115 |
--- perl-5.12.4/cpan/CGI/t/charset.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2116 |
+++ CGI.pm-3.59/cpan/CGI/t/charset.t 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2117 |
@@ -0,0 +1,27 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2118 |
+#!perl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2119 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2120 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2121 |
+use warnings; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2122 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2123 |
+use Test::More 'no_plan'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2124 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2125 |
+use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2126 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2127 |
+my $q = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2128 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2129 |
+like( $q->header |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2130 |
+ , qr/charset=ISO-8859-1/, "charset ISO-8859-1 is set by default for default content-type"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2131 |
+like( $q->header('application/json') |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2132 |
+ , qr/charset=ISO-8859-1/, "charset ISO-8859-1 is set by default for application/json content-type"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2133 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2134 |
+{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2135 |
+ $q->charset('UTF-8'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2136 |
+ my $out = $q->header('text/plain'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2137 |
+ like($out, qr{Content-Type: text/plain; charset=UTF-8}, "setting charset alters header of text/plain"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2138 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2139 |
+{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2140 |
+ $q->charset('UTF-8'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2141 |
+ my $out = $q->header('application/json'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2142 |
+ like($out, qr{Content-Type: application/json; charset=UTF-8}, "setting charset alters header of application/json"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2143 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2144 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2145 |
diff -Naur perl-5.12.4/cpan/CGI/t/cookie.t CGI.pm-3.59/cpan/CGI/t/cookie.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2146 |
--- perl-5.12.4/cpan/CGI/t/cookie.t 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2147 |
+++ CGI.pm-3.59/cpan/CGI/t/cookie.t 2011-04-28 07:34:54.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2148 |
@@ -1,23 +1,29 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2149 |
-#!/usr/local/bin/perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2150 |
+#!perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2151 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2152 |
use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2153 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2154 |
-use Test::More tests => 96; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2155 |
+# to have a consistent baseline, we nail the current time |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2156 |
+# to 100 seconds after the epoch |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2157 |
+BEGIN { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2158 |
+ *CORE::GLOBAL::time = sub { 100 }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2159 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2160 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2161 |
+use Test::More 'no_plan'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2162 |
use CGI::Util qw(escape unescape); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2163 |
use POSIX qw(strftime); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2164 |
+use CGI::Cookie; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2165 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2166 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2167 |
# make sure module loaded |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2168 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2169 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2170 |
-BEGIN {use_ok('CGI::Cookie');} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2171 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2172 |
my @test_cookie = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2173 |
- 'foo=123; bar=qwerty; baz=wibble; qux=a1', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2174 |
- 'foo=123; bar=qwerty; baz=wibble;', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2175 |
- 'foo=vixen; bar=cow; baz=bitch; qux=politician', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2176 |
- 'foo=a%20phrase; bar=yes%2C%20a%20phrase; baz=%5Ewibble; qux=%27', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2177 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2178 |
+ # including leading and trailing whitespace in first cookie |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2179 |
+ ' foo=123 ; bar=qwerty; baz=wibble; qux=a1', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2180 |
+ 'foo=123; bar=qwerty; baz=wibble;', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2181 |
+ 'foo=vixen; bar=cow; baz=bitch; qux=politician', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2182 |
+ 'foo=a%20phrase; bar=yes%2C%20a%20phrase; baz=%5Ewibble; qux=%27', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2183 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2184 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2185 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2186 |
# Test parse |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2187 |
@@ -25,23 +31,29 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2188 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2189 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2190 |
my $result = CGI::Cookie->parse($test_cookie[0]); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2191 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2192 |
is(ref($result), 'HASH', "Hash ref returned in scalar context"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2193 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2194 |
my @result = CGI::Cookie->parse($test_cookie[0]); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2195 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2196 |
is(@result, 8, "returns correct number of fields"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2197 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2198 |
@result = CGI::Cookie->parse($test_cookie[1]); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2199 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2200 |
is(@result, 6, "returns correct number of fields"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2201 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2202 |
my %result = CGI::Cookie->parse($test_cookie[0]); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2203 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2204 |
is($result{foo}->value, '123', "cookie foo is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2205 |
is($result{bar}->value, 'qwerty', "cookie bar is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2206 |
is($result{baz}->value, 'wibble', "cookie baz is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2207 |
is($result{qux}->value, 'a1', "cookie qux is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2208 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2209 |
+ my @array = CGI::Cookie->parse(''); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2210 |
+ my $scalar = CGI::Cookie->parse(''); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2211 |
+ is_deeply(\@array, [], " parse('') returns an empty array in list context (undocumented)"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2212 |
+ is_deeply($scalar, {}, " parse('') returns an empty hashref in scalar context (undocumented)"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2213 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2214 |
+ @array = CGI::Cookie->parse(undef); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2215 |
+ $scalar = CGI::Cookie->parse(undef); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2216 |
+ is_deeply(\@array, [], " parse(undef) returns an empty array in list context (undocumented)"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2217 |
+ is_deeply($scalar, {}, " parse(undef) returns an empty hashref in scalar context (undocumented)"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2218 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2219 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2220 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2221 |
@@ -126,6 +138,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2222 |
is($result{bar}, 'yes%2C%20a%20phrase', "cookie bar is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2223 |
is($result{baz}, '%5Ewibble', "cookie baz is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2224 |
is($result{qux}, '%27', "cookie qux is correct"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2225 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2226 |
+ $ENV{COOKIE} = '$Version=1; foo; $Path="/test"'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2227 |
+ %result = CGI::Cookie->raw_fetch(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2228 |
+ is($result{foo}, '', 'no value translates to empty string'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2229 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2230 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2231 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2232 |
@@ -135,12 +151,13 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2233 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2234 |
# Try new with full information provided |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2235 |
my $c = CGI::Cookie->new(-name => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2236 |
- -value => 'bar', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2237 |
- -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2238 |
- -domain => '.capricorn.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2239 |
- -path => '/cgi-bin/database', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2240 |
- -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2241 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2242 |
+ -value => 'bar', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2243 |
+ -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2244 |
+ -domain => '.capricorn.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2245 |
+ -path => '/cgi-bin/database', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2246 |
+ -secure => 1, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2247 |
+ -httponly=> 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2248 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2249 |
is(ref($c), 'CGI::Cookie', 'new returns objects of correct type'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2250 |
is($c->name , 'foo', 'name is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2251 |
is($c->value , 'bar', 'value is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2252 |
@@ -148,11 +165,12 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2253 |
is($c->domain , '.capricorn.com', 'domain is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2254 |
is($c->path , '/cgi-bin/database', 'path is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2255 |
ok($c->secure , 'secure attribute is set'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2256 |
+ ok( $c->httponly, 'httponly attribute is set' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2257 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2258 |
# now try it with the only two manditory values (should also set the default path) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2259 |
$c = CGI::Cookie->new(-name => 'baz', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2260 |
- -value => 'qux', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2261 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2262 |
+ -value => 'qux', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2263 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2264 |
is(ref($c), 'CGI::Cookie', 'new returns objects of correct type'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2265 |
is($c->name , 'baz', 'name is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2266 |
is($c->value , 'qux', 'value is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2267 |
@@ -160,6 +178,7 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2268 |
ok(!defined $c->domain , 'domain attributeis not set'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2269 |
is($c->path, '/', 'path atribute is set to default'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2270 |
ok(!defined $c->secure , 'secure attribute is set'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2271 |
+ ok( !defined $c->httponly, 'httponly attribute is not set' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2272 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2273 |
# I'm really not happy about the restults of this section. You pass |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2274 |
# the new method invalid arguments and it just merilly creates a |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2275 |
@@ -186,12 +205,13 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2276 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2277 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2278 |
my $c = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2279 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2280 |
- -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2281 |
- -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2282 |
- -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2283 |
- -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2284 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2285 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2286 |
+ -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2287 |
+ -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2288 |
+ -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2289 |
+ -secure => 1, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2290 |
+ -httponly=> 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2291 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2292 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2293 |
my $name = $c->name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2294 |
like($c->as_string, "/$name/", "Stringified cookie contains name"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2295 |
@@ -210,9 +230,12 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2296 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2297 |
like($c->as_string, '/secure/', "Stringified cookie contains secure"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2298 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2299 |
+ like( $c->as_string, '/HttpOnly/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2300 |
+ "Stringified cookie contains HttpOnly" ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2301 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2302 |
$c = CGI::Cookie->new(-name => 'Hamster-Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2303 |
- -value => 'Tulip', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2304 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2305 |
+ -value => 'Tulip', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2306 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2307 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2308 |
$name = $c->name; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2309 |
like($c->as_string, "/$name/", "Stringified cookie contains name"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2310 |
@@ -228,6 +251,9 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2311 |
like($c->as_string, "/$path/", "Stringified cookie contains path"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2312 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2313 |
ok($c->as_string !~ /secure/, "Stringified cookie does not contain secure"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2314 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2315 |
+ ok( $c->as_string !~ /HttpOnly/, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2316 |
+ "Stringified cookie does not contain HttpOnly" ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2317 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2318 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2319 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2320 |
@@ -236,38 +262,38 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2321 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2322 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2323 |
my $c1 = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2324 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2325 |
- -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2326 |
- -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2327 |
- -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2328 |
- -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2329 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2330 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2331 |
+ -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2332 |
+ -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2333 |
+ -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2334 |
+ -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2335 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2336 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2337 |
# have to use $c1->expires because the time will occasionally be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2338 |
# different between the two creates causing spurious failures. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2339 |
my $c2 = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2340 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2341 |
- -expires => $c1->expires, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2342 |
- -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2343 |
- -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2344 |
- -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2345 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2346 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2347 |
+ -expires => $c1->expires, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2348 |
+ -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2349 |
+ -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2350 |
+ -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2351 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2352 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2353 |
# This looks titally whacked, but it does the -1, 0, 1 comparison |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2354 |
# thing so 0 means they match |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2355 |
is($c1->compare("$c1"), 0, "Cookies are identical"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2356 |
- is($c1->compare("$c2"), 0, "Cookies are identical"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2357 |
+ is( "$c1", "$c2", "Cookies are identical"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2358 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2359 |
$c1 = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2360 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2361 |
- -domain => '.foo.bar.com' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2362 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2363 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2364 |
+ -domain => '.foo.bar.com' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2365 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2366 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2367 |
# have to use $c1->expires because the time will occasionally be |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2368 |
# different between the two creates causing spurious failures. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2369 |
$c2 = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2370 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2371 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2372 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2373 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2374 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2375 |
# This looks titally whacked, but it does the -1, 0, 1 comparison |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2376 |
# thing so 0 (i.e. false) means they match |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2377 |
@@ -284,12 +310,12 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2378 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2379 |
{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2380 |
my $c = CGI::Cookie->new(-name => 'Jam', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2381 |
- -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2382 |
- -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2383 |
- -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2384 |
- -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2385 |
- -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2386 |
- ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2387 |
+ -value => 'Hamster', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2388 |
+ -expires => '+3M', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2389 |
+ -domain => '.pie-shop.com', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2390 |
+ -path => '/', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2391 |
+ -secure => 1 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2392 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2393 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2394 |
is($c->name, 'Jam', 'name is correct'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2395 |
is($c->name('Clash'), 'Clash', 'name is set correctly'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2396 |
@@ -321,6 +347,36 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2397 |
ok(!$c->secure, 'secure attribute is cleared'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2398 |
} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2399 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2400 |
+#---------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2401 |
+# Max-age |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2402 |
+#---------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2403 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2404 |
+MAX_AGE: { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2405 |
+ my $cookie = CGI::Cookie->new( -name=>'a', value=>'b', '-expires' => 'now',); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2406 |
+ is $cookie->expires, 'Thu, 01-Jan-1970 00:01:40 GMT'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2407 |
+ is $cookie->max_age => undef, 'max-age is undefined when setting expires'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2408 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2409 |
+ $cookie = CGI::Cookie->new( -name=>'a', 'value'=>'b' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2410 |
+ $cookie->max_age( '+4d' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2411 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2412 |
+ is $cookie->expires, undef, 'expires is undef when setting max_age'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2413 |
+ is $cookie->max_age => 4*24*60*60, 'setting via max-age'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2414 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2415 |
+ $cookie->max_age( '113' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2416 |
+ is $cookie->max_age => 13, 'max_age(num) as delta'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2417 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2418 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2419 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2420 |
+#---------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2421 |
+# bake |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2422 |
+#---------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2423 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2424 |
+BAKE: { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2425 |
+ my $cookie = CGI::Cookie->new( -name=>'a', value=>'b', '-expires' => 'now',); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2426 |
+ eval { $cookie->bake }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2427 |
+ is($@,'', "calling bake() without mod_perl should survive"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2428 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2429 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2430 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2431 |
# Apache2?::Cookie compatibility. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2432 |
#----------------------------------------------------------------------------- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2433 |
diff -Naur perl-5.12.4/cpan/CGI/t/delete.t CGI.pm-3.59/cpan/CGI/t/delete.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2434 |
--- perl-5.12.4/cpan/CGI/t/delete.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2435 |
+++ CGI.pm-3.59/cpan/CGI/t/delete.t 2011-04-28 07:34:54.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2436 |
@@ -0,0 +1,57 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2437 |
+#!/usr/local/bin/perl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2438 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2439 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2440 |
+use warnings; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2441 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2442 |
+use Test::More; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2443 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2444 |
+use CGI (); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2445 |
+use Config; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2446 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2447 |
+my $loaded = 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2448 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2449 |
+$| = 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2450 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2451 |
+######################### End of black magic. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2452 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2453 |
+# Set up a CGI environment |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2454 |
+$ENV{REQUEST_METHOD} = 'DELETE'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2455 |
+$ENV{QUERY_STRING} = 'game=chess&game=checkers&weather=dull'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2456 |
+$ENV{PATH_INFO} = '/somewhere/else'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2457 |
+$ENV{PATH_TRANSLATED} = '/usr/local/somewhere/else'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2458 |
+$ENV{SCRIPT_NAME} = '/cgi-bin/foo.cgi'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2459 |
+$ENV{SERVER_PROTOCOL} = 'HTTP/1.0'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2460 |
+$ENV{SERVER_PORT} = 8080; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2461 |
+$ENV{SERVER_NAME} = 'the.good.ship.lollypop.com'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2462 |
+$ENV{REQUEST_URI} = "$ENV{SCRIPT_NAME}$ENV{PATH_INFO}?$ENV{QUERY_STRING}"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2463 |
+$ENV{HTTP_LOVE} = 'true'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2464 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2465 |
+my $q = new CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2466 |
+ok $q,"CGI::new()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2467 |
+is $q->request_method => 'DELETE',"CGI::request_method()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2468 |
+is $q->query_string => 'game=chess;game=checkers;weather=dull',"CGI::query_string()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2469 |
+is $q->param(), 2,"CGI::param()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2470 |
+is join(' ',sort $q->param()), 'game weather',"CGI::param()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2471 |
+is $q->param('game'), 'chess',"CGI::param()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2472 |
+is $q->param('weather'), 'dull',"CGI::param()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2473 |
+is join(' ',$q->param('game')), 'chess checkers',"CGI::param()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2474 |
+ok $q->param(-name=>'foo',-value=>'bar'),'CGI::param() put'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2475 |
+is $q->param(-name=>'foo'), 'bar','CGI::param() get'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2476 |
+is $q->query_string, 'game=chess;game=checkers;weather=dull;foo=bar',"CGI::query_string() redux"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2477 |
+is $q->http('love'), 'true',"CGI::http()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2478 |
+is $q->script_name, '/cgi-bin/foo.cgi',"CGI::script_name()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2479 |
+is $q->url, 'http://the.good.ship.lollypop.com:8080/cgi-bin/foo.cgi',"CGI::url()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2480 |
+is $q->self_url, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2481 |
+ 'http://the.good.ship.lollypop.com:8080/cgi-bin/foo.cgi/somewhere/else?game=chess;game=checkers;weather=dull;foo=bar', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2482 |
+ "CGI::url()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2483 |
+is $q->url(-absolute=>1), '/cgi-bin/foo.cgi','CGI::url(-absolute=>1)'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2484 |
+is $q->url(-relative=>1), 'foo.cgi','CGI::url(-relative=>1)'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2485 |
+is $q->url(-relative=>1,-path=>1), 'foo.cgi/somewhere/else','CGI::url(-relative=>1,-path=>1)'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2486 |
+is $q->url(-relative=>1,-path=>1,-query=>1), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2487 |
+ 'foo.cgi/somewhere/else?game=chess;game=checkers;weather=dull;foo=bar', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2488 |
+ 'CGI::url(-relative=>1,-path=>1,-query=>1)'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2489 |
+$q->delete('foo'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2490 |
+ok !$q->param('foo'),'CGI::delete()'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2491 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2492 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2493 |
+done_testing(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2494 |
diff -Naur perl-5.12.4/cpan/CGI/t/fast.t CGI.pm-3.59/cpan/CGI/t/fast.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2495 |
--- perl-5.12.4/cpan/CGI/t/fast.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2496 |
+++ CGI.pm-3.59/cpan/CGI/t/fast.t 2011-12-30 05:07:26.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2497 |
@@ -0,0 +1,34 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2498 |
+#!perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2499 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2500 |
+my $fcgi; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2501 |
+BEGIN { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2502 |
+ local $@; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2503 |
+ eval { require FCGI }; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2504 |
+ $fcgi = $@ ? 0 : 1; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2505 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2506 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2507 |
+use Test::More tests => 9; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2508 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2509 |
+# Shut up "used only once" warnings. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2510 |
+() = $CGI::Q; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2511 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2512 |
+SKIP: { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2513 |
+ skip( 'FCGI not installed, cannot continue', 9 ) unless $fcgi; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2514 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2515 |
+ require CGI::Fast; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2516 |
+ ok( my $q = CGI::Fast->new(), 'created new CGI::Fast object' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2517 |
+ is( $q, $CGI::Q, 'checking to see if the object was stored properly' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2518 |
+ is( $q->param(), (), 'no params' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2519 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2520 |
+ ok( $q = CGI::Fast->new({ foo => 'bar' }), 'creating object with params' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2521 |
+ is( $q->param('foo'), 'bar', 'checking passed param' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2522 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2523 |
+ is($CGI::PRIVATE_TEMPFILES,0, "reality check default value for CGI::PRIVATE_TEMPFILES"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2524 |
+ import CGI::Fast '-private_tempfiles'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2525 |
+ CGI::Fast->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2526 |
+ is($CGI::PRIVATE_TEMPFILES,1, "pragma in subclass set package variable in parent class. "); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2527 |
+ $q = CGI::Fast->new({ a => 1 }); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2528 |
+ ok($q, "reality check: something was returned from CGI::Fast->new besides undef"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2529 |
+ is($CGI::PRIVATE_TEMPFILES,1, "package variable in parent class persists through multiple calls to CGI::Fast->new "); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2530 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2531 |
+}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2532 |
diff -Naur perl-5.12.4/cpan/CGI/t/gen-tests/gen-start-end-tags.pl CGI.pm-3.59/cpan/CGI/t/gen-tests/gen-start-end-tags.pl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2533 |
--- perl-5.12.4/cpan/CGI/t/gen-tests/gen-start-end-tags.pl 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2534 |
+++ CGI.pm-3.59/cpan/CGI/t/gen-tests/gen-start-end-tags.pl 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2535 |
@@ -0,0 +1,75 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2536 |
+#!/usr/bin/perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2537 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2538 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2539 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2540 |
+my @tags = |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2541 |
+ ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2542 |
+ "h1","h2","h3","h4","h5","h6", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2543 |
+ "table","ul","li","ol","td", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2544 |
+ "b","i","u","div", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2545 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2546 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2547 |
+my $the_tag; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2548 |
+my $tests_body = ""; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2549 |
+my $num_tests = 0; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2550 |
+foreach $the_tag (@tags) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2551 |
+{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2552 |
+ my $start_or_end; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2553 |
+ foreach $start_or_end (qw(start end)) |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2554 |
+ { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2555 |
+ my $slash = ($start_or_end eq "start") ? "" : "/"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2556 |
+ $tests_body .= "is(${start_or_end}_${the_tag}(), \"<${slash}${the_tag}>\", \"${start_or_end}_${the_tag}\"); # TEST\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2557 |
+ $num_tests++; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2558 |
+ if ($start_or_end eq "start") |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2559 |
+ { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2560 |
+ $tests_body .= "is(${start_or_end}_${the_tag}({class => 'hello'}), \"<${slash}${the_tag} class=\\\"hello\\\">\", \"${start_or_end}_${the_tag} with param\"); # TEST\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2561 |
+ $num_tests++; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2562 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2563 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2564 |
+ $tests_body .= "\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2565 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2566 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2567 |
+my $header1 = <<"EOF"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2568 |
+#!/usr/local/bin/perl -w |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2569 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2570 |
+use lib qw(t/lib); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2571 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2572 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2573 |
+# Due to a bug in older versions of MakeMaker & Test::Harness, we must |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2574 |
+# ensure the blib's are in \@INC, else we might use the core CGI.pm |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2575 |
+use lib qw(blib/lib blib/arch); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2576 |
+EOF |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2577 |
+; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2578 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2579 |
+my $header2 = "use Test::More tests => $num_tests;\n\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2580 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2581 |
+my $header3; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2582 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2583 |
+sub write_file |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2584 |
+{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2585 |
+ my %args = (@_); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2586 |
+ local(*O); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2587 |
+ open O, ">t/start_end_" . $args{'filename'} . ".t\n"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2588 |
+ my $content = $header1 . $header2 . |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2589 |
+ "use CGI qw(:standard " . |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2590 |
+ join(" ", @{$args{'use_params'}}) . ");\n\n" . |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2591 |
+ $tests_body; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2592 |
+ print O $content; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2593 |
+ close(O); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2594 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2595 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2596 |
+write_file( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2597 |
+ "filename" => "asterisk", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2598 |
+ "use_params" => [ map {"\*$_" } @tags ], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2599 |
+); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2600 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2601 |
+write_file( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2602 |
+ "filename" => "start", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2603 |
+ "use_params" => [ map {"start_$_"} @tags], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2604 |
+); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2605 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2606 |
+write_file( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2607 |
+ "filename" => "end", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2608 |
+ "use_params" => [ map {"end_$_"} @tags], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2609 |
+); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2610 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2611 |
diff -Naur perl-5.12.4/cpan/CGI/t/html.t CGI.pm-3.59/cpan/CGI/t/html.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2612 |
--- perl-5.12.4/cpan/CGI/t/html.t 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2613 |
+++ CGI.pm-3.59/cpan/CGI/t/html.t 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2614 |
@@ -63,11 +63,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2615 |
is header(), "Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2616 |
"header()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2617 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2618 |
-is header( -type => 'image/gif' ), "Content-Type: image/gif${CRLF}${CRLF}", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2619 |
+is header( -type => 'image/gif', -charset => '' ), "Content-Type: image/gif${CRLF}${CRLF}", |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2620 |
"header()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2621 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2622 |
is header( -type => 'image/gif', -status => '500 Sucks' ), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2623 |
"Status: 500 Sucks${CRLF}Content-Type: image/gif${CRLF}${CRLF}", "header()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2624 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2625 |
+# return to normal |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2626 |
+charset( 'ISO-8859-1' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2627 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2628 |
like header( -nph => 1 ), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2629 |
qr!HTTP/1.0 200 OK${CRLF}Server: cmdline${CRLF}Date:.+${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}!, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2630 |
@@ -85,13 +88,17 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2631 |
<body> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2632 |
END |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2633 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2634 |
-is start_html( -Title => 'The world of foo' ), <<END, "start_html()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2635 |
+is start_html( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2636 |
+ -Title => 'The world of foo' , |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2637 |
+ -Script => [ {-src=> 'foo.js', -charset=>'utf-8'} ], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2638 |
+ ), <<END, "start_html()"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2639 |
<!DOCTYPE html |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2640 |
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2641 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2642 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2643 |
<head> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2644 |
<title>The world of foo</title> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2645 |
+<script src="foo.js" charset="utf-8" type="text/javascript"></script> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2646 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2647 |
</head> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2648 |
<body> |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2649 |
diff -Naur perl-5.12.4/cpan/CGI/t/multipart_init.t CGI.pm-3.59/cpan/CGI/t/multipart_init.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2650 |
--- perl-5.12.4/cpan/CGI/t/multipart_init.t 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2651 |
+++ CGI.pm-3.59/cpan/CGI/t/multipart_init.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2652 |
@@ -1,20 +0,0 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2653 |
-use Test::More 'no_plan'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2654 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2655 |
-use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2656 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2657 |
-my $q = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2658 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2659 |
-my $sv = $q->multipart_init; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2660 |
-like( $sv, qr|Content-Type: multipart/x-mixed-replace;boundary="------- =|, 'multipart_init(), basic'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2661 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2662 |
-like( $sv, qr/$CGI::CRLF$/, 'multipart_init(), ends in CRLF' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2663 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2664 |
-$sv = $q->multipart_init( 'this_is_the_boundary' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2665 |
-like( $sv, qr/boundary="this_is_the_boundary"/, 'multipart_init("simple_boundary")' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2666 |
-$sv = $q->multipart_init( -boundary => 'this_is_another_boundary' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2667 |
-like($sv, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2668 |
- qr/boundary="this_is_another_boundary"/, "multipart_init( -boundary => 'this_is_another_boundary')"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2669 |
- |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2670 |
-$sv = $q->multipart_init; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2671 |
-my $sv2 = $q->multipart_init; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2672 |
-isnt($sv,$sv2,"due to random boundaries, multiple calls produce different results"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2673 |
diff -Naur perl-5.12.4/cpan/CGI/t/param_fetch.t CGI.pm-3.59/cpan/CGI/t/param_fetch.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2674 |
--- perl-5.12.4/cpan/CGI/t/param_fetch.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2675 |
+++ CGI.pm-3.59/cpan/CGI/t/param_fetch.t 2011-01-05 10:13:45.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2676 |
@@ -0,0 +1,26 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2677 |
+#!perl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2678 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2679 |
+# Tests for the param_fetch() method. |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2680 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2681 |
+use Test::More 'no_plan'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2682 |
+use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2683 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2684 |
+{ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2685 |
+ my $q = CGI->new('b=baz;a=foo;a=bar'); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2686 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2687 |
+ is $q->param_fetch('a')->[0] => 'foo', 'first "a" is "foo"'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2688 |
+ is $q->param_fetch( -name => 'a' )->[0] => 'foo', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2689 |
+ 'first "a" is "foo", with -name'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2690 |
+ is $q->param_fetch('a')->[1] => 'bar', 'second "a" is "bar"'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2691 |
+ is_deeply $q->param_fetch('a') => [qw/ foo bar /], 'a is array ref'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2692 |
+ is_deeply $q->param_fetch( -name => 'a' ) => [qw/ foo bar /], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2693 |
+ 'a is array ref, w/ name'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2694 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2695 |
+ is $q->param_fetch('b')->[0] => 'baz', '"b" is "baz"'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2696 |
+ is_deeply $q->param_fetch('b') => [qw/ baz /], 'b is array ref too'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2697 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2698 |
+ is_deeply $q->param_fetch, [], "param_fetch without parameters"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2699 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2700 |
+ is_deeply $q->param_fetch( 'a', 'b' ), [qw/ foo bar /], |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2701 |
+ "param_fetch only take first argument"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2702 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2703 |
diff -Naur perl-5.12.4/cpan/CGI/t/rt-52469.t CGI.pm-3.59/cpan/CGI/t/rt-52469.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2704 |
--- perl-5.12.4/cpan/CGI/t/rt-52469.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2705 |
+++ CGI.pm-3.59/cpan/CGI/t/rt-52469.t 2011-12-30 05:22:19.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2706 |
@@ -0,0 +1,14 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2707 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2708 |
+use warnings; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2709 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2710 |
+use Test::More tests => 1; # last test to print |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2711 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2712 |
+use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2713 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2714 |
+$ENV{REQUEST_METHOD} = 'PUT'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2715 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2716 |
+my $cgi = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2717 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2718 |
+pass 'new() returned'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2719 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2720 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2721 |
diff -Naur perl-5.12.4/cpan/CGI/t/tmpdir.t CGI.pm-3.59/cpan/CGI/t/tmpdir.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2722 |
--- perl-5.12.4/cpan/CGI/t/tmpdir.t 1969-12-31 16:00:00.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2723 |
+++ CGI.pm-3.59/cpan/CGI/t/tmpdir.t 2011-12-30 04:52:33.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2724 |
@@ -0,0 +1,40 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2725 |
+#!perl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2726 |
+use Test::More tests => 9; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2727 |
+use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2728 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2729 |
+my ($testdir, $testdir2); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2730 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2731 |
+BEGIN { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2732 |
+ $testdir = "CGItest"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2733 |
+ $testdir2 = "CGItest2"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2734 |
+ for ($testdir, $testdir2) { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2735 |
+ ( -d ) || mkdir $_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2736 |
+ ( ! -w ) || chmod 0700, $_; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2737 |
+ } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2738 |
+ $CGITempFile::TMPDIRECTORY = $testdir; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2739 |
+ $ENV{TMPDIR} = $testdir2; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2740 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2741 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2742 |
+use CGI; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2743 |
+is($CGITempFile::TMPDIRECTORY, $testdir, "can pre-set \$CGITempFile::TMPDIRECTORY"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2744 |
+CGITempFile->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2745 |
+is($CGITempFile::TMPDIRECTORY, $testdir, "\$CGITempFile::TMPDIRECTORY unchanged"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2746 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2747 |
+TODO: { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2748 |
+ local $TODO = "figuring out why these tests fail on some platforms"; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2749 |
+ ok(chmod 0500, $testdir, "revoking write access to $testdir"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2750 |
+ ok(! -w $testdir, "write access to $testdir revoked"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2751 |
+CGITempFile->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2752 |
+is($CGITempFile::TMPDIRECTORY, $testdir2, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2753 |
+ "unwritable \$CGITempFile::TMPDIRECTORY overridden"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2754 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2755 |
+ok(chmod 0500, $testdir2, "revoking write access to $testdir2"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2756 |
+ok(! -w $testdir, "write access to $testdir revoked"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2757 |
+CGITempFile->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2758 |
+isnt($CGITempFile::TMPDIRECTORY, $testdir2, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2759 |
+ "unwritable \$ENV{TMPDIR} overridden"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2760 |
+isnt($CGITempFile::TMPDIRECTORY, $testdir, |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2761 |
+ "unwritable \$ENV{TMPDIR} not overridden with an unwritable \$CGITempFile::TMPDIRECTORY"); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2762 |
+} |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2763 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2764 |
+END { for ($testdir, $testdir2) { chmod 0700, $_; rmdir; } } |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2765 |
diff -Naur perl-5.12.4/cpan/CGI/t/url.t CGI.pm-3.59/cpan/CGI/t/url.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2766 |
--- perl-5.12.4/cpan/CGI/t/url.t 2011-06-01 00:47:46.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2767 |
+++ CGI.pm-3.59/cpan/CGI/t/url.t 2011-11-09 07:49:15.000000000 -0800 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2768 |
@@ -1,9 +1,10 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2769 |
use strict; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2770 |
use warnings; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2771 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2772 |
-use Test::More tests => 4; # last test to print |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2773 |
+use Test::More; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2774 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2775 |
+use CGI ':all'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2776 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2777 |
-use CGI qw/ :all /; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2778 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2779 |
$ENV{HTTP_X_FORWARDED_HOST} = 'proxy:8484'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2780 |
$ENV{SERVER_PROTOCOL} = 'HTTP/1.0'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2781 |
@@ -21,3 +22,51 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2782 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2783 |
is url() => 'http://proxy', 'url() with default port'; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2784 |
|
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2785 |
+subtest 'rewrite_interactions' => sub { |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2786 |
+ # Reference: RT#45019 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2787 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2788 |
+ local %ENV = ( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2789 |
+ # These two are always set |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2790 |
+ 'SCRIPT_NAME' => '/real/cgi-bin/dispatch.cgi', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2791 |
+ 'SCRIPT_FILENAME' => '/home/mark/real/path/cgi-bin/dispatch.cgi', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2792 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2793 |
+ # These two are added by mod_rewrite Ref: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2794 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2795 |
+ 'SCRIPT_URL' => '/real/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2796 |
+ 'SCRIPT_URI' => 'http://example.com/real/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2797 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2798 |
+ 'PATH_INFO' => '/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2799 |
+ 'REQUEST_URI' => '/real/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2800 |
+ 'HTTP_HOST' => 'example.com' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2801 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2802 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2803 |
+ my $q = CGI->new; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2804 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2805 |
+ is( |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2806 |
+ $q->url( -absolute => 1, -query => 1, -path_info => 1 ), |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2807 |
+ '/real/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2808 |
+ '$q->url( -absolute => 1, -query => 1, -path_info => 1 ) should return complete path, even when mod_rewrite is detected.' |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2809 |
+ ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2810 |
+ is( $q->url(), 'http://example.com/real', '$q->url(), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2811 |
+ is( $q->url(-full=>1), 'http://example.com/real', '$q->url(-full=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2812 |
+ is( $q->url(-path=>1), 'http://example.com/real/path/info', '$q->url(-path=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2813 |
+ is( $q->url(-path=>0), 'http://example.com/real', '$q->url(-path=>0), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2814 |
+ is( $q->url(-full=>1,-path=>1), 'http://example.com/real/path/info', '$q->url(-full=>1,-path=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2815 |
+ is( $q->url(-rewrite=>1,-path=>0), 'http://example.com/real', '$q->url(-rewrite=>1,-path=>0), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2816 |
+ is( $q->url(-rewrite=>1), 'http://example.com/real', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2817 |
+ '$q->url(-rewrite=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2818 |
+ is( $q->url(-rewrite=>0), 'http://example.com/real/cgi-bin/dispatch.cgi', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2819 |
+ '$q->url(-rewrite=>0), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2820 |
+ is( $q->url(-rewrite=>0,-path=>1), 'http://example.com/real/cgi-bin/dispatch.cgi/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2821 |
+ '$q->url(-rewrite=>0,-path=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2822 |
+ is( $q->url(-rewrite=>1,-path=>1), 'http://example.com/real/path/info', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2823 |
+ '$q->url(-rewrite=>1,-path=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2824 |
+ is( $q->url(-rewrite=>0,-path=>0), 'http://example.com/real/cgi-bin/dispatch.cgi', |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2825 |
+ '$q->url(-rewrite=>0,-path=>1), with rewriting detected' ); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2826 |
+ done_testing(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2827 |
+}; |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2828 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2829 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2830 |
+done_testing(); |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2831 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2832 |
+ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2833 |
diff -Naur perl-5.12.4/MANIFEST CGI.pm-3.59/MANIFEST |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2834 |
--- perl-5.12.4/MANIFEST 2011-06-07 13:04:05.000000000 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2835 |
+++ CGI.pm-3.59/MANIFEST 2012-06-13 14:15:21.906099448 -0700 |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2836 |
@@ -198,30 +198,36 @@ |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2837 |
cpan/CGI/t/autoescape.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2838 |
cpan/CGI/t/can.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2839 |
cpan/CGI/t/carp.t See if CGI::Carp works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2840 |
+cpan/CGI/t/charset.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2841 |
cpan/CGI/t/checkbox_group.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2842 |
cpan/CGI/t/cookie.t See if CGI::Cookie works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2843 |
+cpan/CGI/t/delete.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2844 |
cpan/CGI/t/Dump.t See if CGI->Dump works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2845 |
cpan/CGI/t/end_form.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2846 |
+cpan/CGI/t/fast.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2847 |
cpan/CGI/t/form.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2848 |
cpan/CGI/t/function.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2849 |
+cpan/CGI/t/gen-tests/gen-start-end-tags.pl |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2850 |
cpan/CGI/t/headers.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2851 |
cpan/CGI/t/hidden.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2852 |
cpan/CGI/t/html.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2853 |
cpan/CGI/t/http.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2854 |
cpan/CGI/t/init.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2855 |
cpan/CGI/t/init_test.txt See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2856 |
-cpan/CGI/t/multipart_init.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2857 |
cpan/CGI/t/no_tabindex.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2858 |
+cpan/CGI/t/param_fetch.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2859 |
cpan/CGI/t/popup_menu.t See if CGI pop menus work |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2860 |
cpan/CGI/t/pretty.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2861 |
cpan/CGI/t/push.t See if CGI::Push works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2862 |
cpan/CGI/t/query_string.t See if CGI->query_string() works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2863 |
cpan/CGI/t/request.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2864 |
+cpan/CGI/t/rt-52469.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2865 |
cpan/CGI/t/save_read_roundtrip.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2866 |
cpan/CGI/t/start_end_asterisk.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2867 |
cpan/CGI/t/start_end_end.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2868 |
cpan/CGI/t/start_end_start.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2869 |
cpan/CGI/t/switch.t See if CGI::Switch still loads |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2870 |
+cpan/CGI/t/tmpdir.t |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2871 |
cpan/CGI/t/unescapeHTML.t See if CGI::unescapeHTML() works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2872 |
cpan/CGI/t/uploadInfo.t See if CGI.pm works |
cd5a2da081ff
7030196 Problem with utility/perl
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2873 |
cpan/CGI/t/upload_post_text.txt Test data for CGI.pm |