components/perl/perl516/patches/CGI-3.63.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 13 Oct 2014 14:17:14 -0700
changeset 2147 0cb80a8f6f24
parent 1350 f4d6496d9297
permissions -rw-r--r--
Close of build 59.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1350
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     1
diff -ur CGI/Changes CGI.pm-3.63/Changes
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     2
--- a/cpan/CGI/Changes	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     3
+++ b/cpan/CGI.pm-3.63/Changes	Wed Nov 14 17:43:13 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     4
@@ -1,3 +1,54 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     5
+Version 3.63 Nov 12, 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     6
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     7
+    [SECURITY]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     8
+    - CR escaping for Set-Cookie and P3P headers was improved. There was potential
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     9
+      for newline injection in these headers. 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    10
+      (Thanks to anazawa, https://github.com/markstos/CGI.pm/pull/23)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    11
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    12
+Version 3.62, Nov 9th, 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    13
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    14
+    [INTERNALS]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    15
+    - Changed how the  deprecated endform function was defined for compatibilty
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    16
+      with the development version of Perl. 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    17
+    - Fix failures in t/tmpdir.t when run as root
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    18
+      https://github.com/markstos/CGI.pm/issues/22, RT#80659)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    19
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    20
+    - Made it possible to force a sorted order for things like hash
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    21
+      attributes so that tests are not dependent on a particular hash
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    22
+      ordering. This will be required in modern perls which will
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    23
+      change the ordering per process. (Yves, RT#80659)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    24
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    25
+Version 3.61 Nov 2nd, 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    26
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    27
+  (No code changes)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    28
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    29
+  [INTERNALS]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    30
+   - formatting of CGI::Carp documentation was improved. Thanks to benkasminbullock.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    31
+   - un-TODO some tests in t/tmpdir.t that were passing in most cases. 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    32
+     More on this:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    33
+       https://github.com/markstos/CGI.pm/issues/19#
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    34
+       https://github.com/markstos/CGI.pm/commit/cc73dc9807b0fabb56b3cdf1a9726588b2eda0f7
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    35
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    36
+Version 3.60 Aug 15th, 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    37
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    38
+  [BUG FIXES]  
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    39
+  - In some caes, When unescapeHTML() hit something it didn't recognize with an ampersand and
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    40
+    and semicolon, it would throw away the semicolon and ampersand. It now does a better job.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    41
+    of preserving content it doesn't recognize. Thanks to [email protected] (RT#75595)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    42
+  - Remove trailing newline after <form> tag inserted by startform and start_form. It can
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    43
+    cause rendering problems in some cases. Thanks to [email protected] (RT#67719)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    44
+  - Workaround "Insecure Dependency" warning generated by some versions of Perl (RT#53733).
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    45
+    Thanks to [email protected], [email protected] and Anonymous Monk 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    46
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    47
+  [DOCUMENTATION] 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    48
+  - Clarify that when -status is used, the human-readable phase should be included, per RFC 2616.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    49
+    Thanks to [email protected] (RT#76691). 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    50
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    51
+  [INTERNALS]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    52
+  - More tests for header(), thanks to Ryo Anazawa.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    53
+  - t/url.t has been fixed on VMS. Thanks to [email protected] (RT#72380)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    54
+  - MANIFEST patched so that t/multipart_init.t is included again. Thanks to [email protected] (RT#76189)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    55
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    56
 Version 3.59 Dec 29th, 2011
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    57
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    58
  [BUG FIXES]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    59
Common subdirectories: CGI/examples and CGI.pm-3.63/examples
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    60
Common subdirectories: CGI/lib and CGI.pm-3.63/lib
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    61
Common subdirectories: CGI/t and CGI.pm-3.63/t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    62
Only in CGI.pm-3.63/examples: WORLD_WRITABLE
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    63
Common subdirectories: CGI/lib/CGI and CGI.pm-3.63/lib/CGI
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    64
diff -ur CGI/lib/CGI.pm CGI.pm-3.63/lib/CGI.pm
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    65
--- a/cpan/CGI/lib/CGI.pm	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    66
+++ b/cpan/CGI.pm-3.63/lib/CGI.pm	Wed Nov 14 17:42:54 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    67
@@ -20,7 +20,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    68
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    69
 # The revision is no longer being updated since moving to git. 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    70
 $CGI::revision = '$Id: CGI.pm,v 1.266 2009/07/30 16:32:34 lstein Exp $';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    71
-$CGI::VERSION='3.59';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    72
+$CGI::VERSION='3.63';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    73
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    74
 # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    75
 # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    76
@@ -129,10 +129,6 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    77
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    78
 # ------------------ START OF THE LIBRARY ------------
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    79
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    80
-#### Method: endform
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    81
-# This method is DEPRECATED
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    82
-*endform = \&end_form;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    83
-
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    84
 # make mod_perlhappy
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    85
 initialize_globals();
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    86
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    87
@@ -530,7 +526,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    88
             my $val = $QUERY_PARAM{$name}; # always an arrayref;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    89
             $self->param('-name'=>$name,'-value'=> $val);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    90
             if (defined $val and ref $val eq 'ARRAY') {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    91
-                for my $fh (grep {defined(fileno($_))} @$val) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    92
+                for my $fh (grep {defined($_) && ref($_) && defined(fileno($_))} @$val) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    93
                    seek($fh,0,0); # reset the filehandle.  
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    94
                 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    95
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    96
@@ -812,7 +808,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    97
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    98
 # put a filehandle into binary mode (DOS)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    99
 sub binmode {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   100
-    return unless defined($_[1]) && defined fileno($_[1]);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   101
+    return unless defined($_[1]) && ref ($_[1]) && defined fileno($_[1]);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   102
     CORE::binmode($_[1]);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   103
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   104
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   105
@@ -1501,8 +1497,17 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   106
                             'EXPIRES','NPH','CHARSET',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   107
                             'ATTACHMENT','P3P'],@p);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   108
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   109
+    # Since $cookie and $p3p may be array references,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   110
+    # we must stringify them before CR escaping is done.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   111
+    my @cookie;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   112
+    for (ref($cookie) eq 'ARRAY' ? @{$cookie} : $cookie) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   113
+        my $cs = UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   114
+        push(@cookie,$cs) if defined $cs and $cs ne '';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   115
+    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   116
+    $p3p = join ' ',@$p3p if ref($p3p) eq 'ARRAY';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   117
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   118
     # CR escaping for values, per RFC 822
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   119
-    for my $header ($type,$status,$cookie,$target,$expires,$nph,$charset,$attachment,$p3p,@other) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   120
+    for my $header ($type,$status,@cookie,$target,$expires,$nph,$charset,$attachment,$p3p,@other) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   121
         if (defined $header) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   122
             # From RFC 822:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   123
             # Unfolding  is  accomplished  by regarding   CRLF   immediately
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   124
@@ -1546,18 +1551,9 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   125
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   126
     push(@header,"Status: $status") if $status;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   127
     push(@header,"Window-Target: $target") if $target;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   128
-    if ($p3p) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   129
-       $p3p = join ' ',@$p3p if ref($p3p) eq 'ARRAY';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   130
-       push(@header,qq(P3P: policyref="/w3c/p3p.xml", CP="$p3p"));
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   131
-    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   132
+    push(@header,"P3P: policyref=\"/w3c/p3p.xml\", CP=\"$p3p\"") if $p3p;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   133
     # push all the cookies -- there may be several
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   134
-    if ($cookie) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   135
-	my(@cookie) = ref($cookie) && ref($cookie) eq 'ARRAY' ? @{$cookie} : $cookie;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   136
-	for (@cookie) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   137
-            my $cs = UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   138
-	    push(@header,"Set-Cookie: $cs") if $cs ne '';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   139
-	}
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   140
-    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   141
+    push(@header,map {"Set-Cookie: $_"} @cookie);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   142
     # if the user indicates an expiration time, then we need
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   143
     # both an Expires and a Date header (so that the browser is
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   144
     # uses OUR clock)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   145
@@ -1904,7 +1900,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   146
     $action = qq(action="$action");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   147
     my($other) = @other ? " @other" : '';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   148
     $self->{'.parametersToAdd'}={};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   149
-    return qq/<form method="$method" $action enctype="$enctype"$other>\n/;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   150
+    return qq/<form method="$method" $action enctype="$enctype"$other>/;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   151
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   152
 END_OF_FUNC
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   153
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   154
@@ -1938,7 +1934,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   155
     $action = qq(action="$action");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   156
     my($other) = @other ? " @other" : '';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   157
     $self->{'.parametersToAdd'}={};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   158
-    return qq/<form method="$method" $action enctype="$enctype"$other>\n/;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   159
+    return qq/<form method="$method" $action enctype="$enctype"$other>/;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   160
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   161
 END_OF_FUNC
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   162
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   163
@@ -1960,6 +1956,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   164
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   165
 #### Method: end_form
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   166
 # End a form
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   167
+# Note: This repeated below under the older name.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   168
 'end_form' => <<'END_OF_FUNC',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   169
 sub end_form {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   170
     my($self,@p) = self_or_default(@_);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   171
@@ -1976,6 +1973,22 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   172
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   173
 END_OF_FUNC
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   174
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   175
+'endform' => <<'END_OF_FUNC',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   176
+sub endform {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   177
+    my($self,@p) = self_or_default(@_);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   178
+    if ( $NOSTICKY ) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   179
+        return wantarray ? ("</form>") : "\n</form>";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   180
+    } else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   181
+        if (my @fields = $self->get_fields) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   182
+            return wantarray ? ("<div>",@fields,"</div>","</form>")
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   183
+                             : "<div>".(join '',@fields)."</div>\n</form>";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   184
+        } else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   185
+            return "</form>";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   186
+        }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   187
+    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   188
+}
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   189
+END_OF_FUNC
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   190
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   191
 #### Method: end_multipart_form
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   192
 # end a multipart form
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   193
 'end_multipart_form' => <<'END_OF_FUNC',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   194
@@ -2311,7 +2324,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   195
     my $latin = defined $self->{'.charset'} ? $self->{'.charset'} =~ /^(ISO-8859-1|WINDOWS-1252)$/i
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   196
                                             : 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   197
     # thanks to Randal Schwartz for the correct solution to this one
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   198
-    $string=~ s[&(\S*?);]{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   199
+    $string=~ s[&([^\s&]*?);]{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   200
 	local $_ = $1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   201
 	/^amp$/i	? "&" :
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   202
 	/^quot$/i	? '"' :
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   203
@@ -2319,7 +2332,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   204
 	/^lt$/i		? "<" :
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   205
 	/^#(\d+)$/ && $latin	     ? chr($1) :
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   206
 	/^#x([0-9a-f]+)$/i && $latin ? chr(hex($1)) :
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   207
-	$_
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   208
+	"&$_;"
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   209
 	}gex;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   210
     return $string;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   211
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   212
@@ -5184,7 +5197,8 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   213
 MIME type if you choose, otherwise it defaults to text/html.  An
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   214
 optional second parameter specifies the status code and a human-readable
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   215
 message.  For example, you can specify 204, "No response" to create a
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   216
-script that tells the browser to do nothing at all.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   217
+script that tells the browser to do nothing at all. Note that RFC 2616 expects
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   218
+the human-readable phase to be there as well as the numeric status code. 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   219
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   220
 The last example shows the named argument style for passing arguments
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   221
 to the CGI methods using named parameters.  Recognized parameters are
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   222
@@ -5272,7 +5286,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   223
     print $q->redirect(
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   224
         -uri=>'http://somewhere.else/in/movie/land',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   225
 	    -nph=>1,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   226
-         -status=>301);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   227
+         -status=>'301 Moved Permanently');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   228
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   229
 All names arguments recognized by header() are also recognized by
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   230
 redirect(). However, most HTTP headers, including those generated by
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   231
@@ -5295,6 +5309,9 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   232
 advised that changing the status to anything other than 301, 302 or
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   233
 303 will probably break redirection.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   234
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   235
+Note that the human-readable phrase is also expected to be present to conform
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   236
+with RFC 2616, section 6.1.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   237
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   238
 =head2 CREATING THE HTML DOCUMENT HEADER
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   239
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   240
    print start_html(-title=>'Secrets of the Pyramids',
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   241
diff -ur CGI/lib/CGI/Carp.pm CGI.pm-3.63/lib/CGI/Carp.pm
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   242
--- a/cpan/CGI/lib/CGI/Carp.pm	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   243
+++ b/cpan/CGI.pm-3.63/lib/CGI/Carp.pm	Fri Nov  2 19:33:07 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   244
@@ -33,9 +33,9 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   245
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   246
     use CGI::Carp
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   247
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   248
-And the standard warn(), die (), croak(), confess() and carp() calls
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   249
-will automagically be replaced with functions that write out nicely
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   250
-time-stamped messages to the HTTP server error log.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   251
+The standard warn(), die (), croak(), confess() and carp() calls will
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   252
+be replaced with functions that write time-stamped messages to the
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   253
+HTTP server error log.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   254
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   255
 For example:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   256
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   257
@@ -57,10 +57,10 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   258
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   259
    use CGI::Carp qw(carpout);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   260
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   261
-The carpout() function requires one argument, which should be a
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   262
-reference to an open filehandle for writing errors.  It should be
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   263
-called in a C<BEGIN> block at the top of the CGI application so that
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   264
-compiler errors will be caught.  Example:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   265
+The carpout() function requires one argument, a reference to an open
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   266
+filehandle for writing errors.  It should be called in a C<BEGIN>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   267
+block at the top of the CGI application so that compiler errors will
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   268
+be caught.  Example:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   269
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   270
    BEGIN {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   271
      use CGI::Carp qw(carpout);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   272
@@ -69,14 +69,15 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   273
      carpout(LOG);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   274
    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   275
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   276
-carpout() does not handle file locking on the log for you at this point.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   277
-Also, note that carpout() does not work with in-memory file handles, although
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   278
-a patch would be welcome to address that.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   279
+carpout() does not handle file locking on the log for you at this
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   280
+point.  Also, note that carpout() does not work with in-memory file
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   281
+handles, although a patch would be welcome to address that.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   282
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   283
-The real STDERR is not closed -- it is moved to CGI::Carp::SAVEERR.  Some
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   284
-servers, when dealing with CGI scripts, close their connection to the
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   285
-browser when the script closes STDOUT and STDERR.  CGI::Carp::SAVEERR is there to
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   286
-prevent this from happening prematurely.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   287
+The real STDERR is not closed -- it is moved to CGI::Carp::SAVEERR.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   288
+Some servers, when dealing with CGI scripts, close their connection to
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   289
+the browser when the script closes STDOUT and STDERR.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   290
+CGI::Carp::SAVEERR is there to prevent this from happening
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   291
+prematurely.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   292
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   293
 You can pass filehandles to carpout() in a variety of ways.  The "correct"
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   294
 way according to Tom Christiansen is to pass a reference to a filehandle
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   295
@@ -104,17 +105,17 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   296
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   297
 =head1 MAKING PERL ERRORS APPEAR IN THE BROWSER WINDOW
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   298
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   299
-If you want to send fatal (die, confess) errors to the browser, ask to
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   300
-import the special "fatalsToBrowser" subroutine:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   301
+If you want to send fatal (die, confess) errors to the browser, import
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   302
+the special "fatalsToBrowser" subroutine:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   303
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   304
     use CGI::Carp qw(fatalsToBrowser);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   305
     die "Bad error here";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   306
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   307
-Fatal errors will now be echoed to the browser as well as to the log.  CGI::Carp
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   308
-arranges to send a minimal HTTP header to the browser so that even errors that
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   309
-occur in the early compile phase will be seen.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   310
-Nonfatal errors will still be directed to the log file only (unless redirected
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   311
-with carpout).
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   312
+Fatal errors will now be echoed to the browser as well as to the log.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   313
+CGI::Carp arranges to send a minimal HTTP header to the browser so
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   314
+that even errors that occur in the early compile phase will be seen.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   315
+Nonfatal errors will still be directed to the log file only (unless
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   316
+redirected with carpout).
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   317
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   318
 Note that fatalsToBrowser may B<not> work well with mod_perl version 2.0
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   319
 and higher.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   320
@@ -193,10 +194,10 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   321
 This may have some undesireable effects when the purpose of doing the
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   322
 eval is to determine which of several algorithms is to be used.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   323
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   324
-By setting C<$CGI::Carp::TO_BROWSER> to 0 you can suppress printing the C<die> messages
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   325
-but without all of the complexity of using C<set_die_handler>.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   326
-You can localize this effect to inside C<eval> bodies if this is desireable:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   327
-For example:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   328
+By setting C<$CGI::Carp::TO_BROWSER> to 0 you can suppress printing
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   329
+the C<die> messages but without all of the complexity of using
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   330
+C<set_die_handler>.  You can localize this effect to inside C<eval>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   331
+bodies if this is desireable: For example:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   332
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   333
  eval {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   334
    local $CGI::Carp::TO_BROWSER = 0;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   335
@@ -207,12 +208,12 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   336
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   337
 =head1 MAKING WARNINGS APPEAR AS HTML COMMENTS
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   338
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   339
-It is now also possible to make non-fatal errors appear as HTML
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   340
-comments embedded in the output of your program.  To enable this
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   341
-feature, export the new "warningsToBrowser" subroutine.  Since sending
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   342
-warnings to the browser before the HTTP headers have been sent would
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   343
-cause an error, any warnings are stored in an internal buffer until
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   344
-you call the warningsToBrowser() subroutine with a true argument:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   345
+It is also possible to make non-fatal errors appear as HTML comments
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   346
+embedded in the output of your program.  To enable this feature,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   347
+export the new "warningsToBrowser" subroutine.  Since sending warnings
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   348
+to the browser before the HTTP headers have been sent would cause an
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   349
+error, any warnings are stored in an internal buffer until you call
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   350
+the warningsToBrowser() subroutine with a true argument:
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   351
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   352
     use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   353
     use CGI qw(:standard);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   354
@@ -320,12 +321,10 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   355
 This library is free software; you can redistribute it and/or modify
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   356
 it under the same terms as Perl itself.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   357
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   358
-Address bug reports and comments to: [email protected]
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   359
-
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   360
 =head1 SEE ALSO
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   361
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   362
-Carp, CGI::Base, CGI::BasePlus, CGI::Request, CGI::MiniSvr, CGI::Form,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   363
-CGI::Response
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   364
+L<Carp>, L<CGI::Base>, L<CGI::BasePlus>, L<CGI::Request>,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   365
+L<CGI::MiniSvr>, L<CGI::Form>, L<CGI::Response>.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   366
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   367
 =cut
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   368
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   369
diff -ur CGI/lib/CGI/Cookie.pm CGI.pm-3.63/lib/CGI/Cookie.pm
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   370
--- a/cpan/CGI/lib/CGI/Cookie.pm	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   371
+++ b/cpan/CGI.pm-3.63/lib/CGI/Cookie.pm	Wed Aug 15 20:07:03 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   372
@@ -473,7 +473,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   373
    CGI::Cookie->fetch($r);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   374
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   375
 If the value passed to parse() is undefined, an empty array will returned in list
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   376
-contact, and an empty hashref will be returned in scalar context.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   377
+context, and an empty hashref will be returned in scalar context.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   378
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   379
 =head2 Manipulating Cookies
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   380
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   381
diff -ur CGI/lib/CGI/Util.pm CGI.pm-3.63/lib/CGI/Util.pm
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   382
--- a/cpan/CGI/lib/CGI/Util.pm	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   383
+++ b/cpan/CGI.pm-3.63/lib/CGI/Util.pm	Fri Nov  9 19:19:12 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   384
@@ -1,15 +1,19 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   385
 package CGI::Util;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   386
+use base 'Exporter';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   387
 require 5.008001;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   388
 use strict;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   389
-require Exporter;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   390
-our @ISA = qw(Exporter);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   391
-our @EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   392
-		expires ebcdic2ascii ascii2ebcdic);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   393
+our @EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   394
+        expires ebcdic2ascii ascii2ebcdic);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   395
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   396
-our $VERSION = '3.53';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   397
+our $VERSION = '3.62';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   398
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   399
 use constant EBCDIC => "\t" ne "\011";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   400
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   401
+# This option is not documented and may change or go away.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   402
+# The HTML spec does not require attributes to be sorted,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   403
+# but it's useful for testing to get a predictable order back.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   404
+our $SORT_ATTRIBUTES;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   405
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   406
 # (ord('^') == 95) for codepage 1047 as on os390, vmesa
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   407
 our @A2E = (
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   408
    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 21, 11, 12, 13, 14, 15,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   409
@@ -28,7 +32,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   410
  172,105,237,238,235,239,236,191,128,253,254,251,252,186,174, 89,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   411
   68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   412
  140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   413
-	 );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   414
+     );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   415
 our @E2A = (
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   416
    0,  1,  2,  3,156,  9,134,127,151,141,142, 11, 12, 13, 14, 15,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   417
   16, 17, 18, 19,157, 10,  8,135, 24, 25,146,143, 28, 29, 30, 31,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   418
@@ -46,7 +50,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   419
  125, 74, 75, 76, 77, 78, 79, 80, 81, 82,185,251,252,249,250,255,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   420
   92,247, 83, 84, 85, 86, 87, 88, 89, 90,178,212,214,210,211,213,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   421
   48, 49, 50, 51, 52, 53, 54, 55, 56, 57,179,219,220,217,218,159
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   422
-	 );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   423
+     );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   424
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   425
 if (EBCDIC && ord('^') == 106) { # as in the BS2000 posix-bc coded character set
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   426
      $A2E[91] = 187;   $A2E[92] = 188;  $A2E[94] = 106;  $A2E[96] = 74;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   427
@@ -77,7 +81,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   428
     my ($order,@param) = @_;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   429
     my ($result, $leftover) = _rearrange_params( $order, @param );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   430
     push @$result, make_attributes( $leftover, defined $CGI::Q ? $CGI::Q->{escape} : 1 ) 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   431
-	if keys %$leftover;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   432
+    if keys %$leftover;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   433
     @$result;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   434
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   435
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   436
@@ -95,10 +99,10 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   437
     return [] unless @param;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   438
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   439
     if (ref($param[0]) eq 'HASH') {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   440
-	@param = %{$param[0]};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   441
+    @param = %{$param[0]};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   442
     } else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   443
-	return \@param 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   444
-	    unless (defined($param[0]) && substr($param[0],0,1) eq '-');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   445
+    return \@param 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   446
+        unless (defined($param[0]) && substr($param[0],0,1) eq '-');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   447
     }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   448
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   449
     # map parameters into positional indices
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   450
@@ -105,21 +109,21 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   451
     my ($i,%pos);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   452
     $i = 0;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   453
     foreach (@$order) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   454
-	foreach (ref($_) eq 'ARRAY' ? @$_ : $_) { $pos{lc($_)} = $i; }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   455
-	$i++;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   456
+    foreach (ref($_) eq 'ARRAY' ? @$_ : $_) { $pos{lc($_)} = $i; }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   457
+    $i++;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   458
     }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   459
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   460
     my (@result,%leftover);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   461
     $#result = $#$order;  # preextend
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   462
     while (@param) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   463
-	my $key = lc(shift(@param));
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   464
-	$key =~ s/^\-//;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   465
-	if (exists $pos{$key}) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   466
-	    $result[$pos{$key}] = shift(@param);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   467
-	} else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   468
-	    $leftover{$key} = shift(@param);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   469
-	}
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   470
+    my $key = lc(shift(@param));
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   471
+    $key =~ s/^\-//;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   472
+    if (exists $pos{$key}) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   473
+        $result[$pos{$key}] = shift(@param);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   474
+    } else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   475
+        $leftover{$key} = shift(@param);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   476
     }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   477
+    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   478
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   479
     return \@result, \%leftover;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   480
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   481
@@ -132,18 +136,22 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   482
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   483
     my $quote = $do_not_quote ? '' : '"';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   484
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   485
+    my @attr_keys= keys %$attr;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   486
+    if ($SORT_ATTRIBUTES) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   487
+        @attr_keys= sort @attr_keys;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   488
+    }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   489
     my(@att);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   490
-    foreach (keys %{$attr}) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   491
-	my($key) = $_;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   492
-	$key=~s/^\-//;     # get rid of initial - if present
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   493
+    foreach (@attr_keys) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   494
+    my($key) = $_;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   495
+    $key=~s/^\-//;     # get rid of initial - if present
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   496
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   497
-	# old way: breaks EBCDIC!
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   498
-	# $key=~tr/A-Z_/a-z-/; # parameters are lower case, use dashes
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   499
+    # old way: breaks EBCDIC!
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   500
+    # $key=~tr/A-Z_/a-z-/; # parameters are lower case, use dashes
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   501
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   502
-	($key="\L$key") =~ tr/_/-/; # parameters are lower case, use dashes
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   503
+    ($key="\L$key") =~ tr/_/-/; # parameters are lower case, use dashes
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   504
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   505
-	my $value = $escape ? simple_escape($attr->{$_}) : $attr->{$_};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   506
-	push(@att,defined($attr->{$_}) ? qq/$key=$quote$value$quote/ : qq/$key/);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   507
+    my $value = $escape ? simple_escape($attr->{$_}) : $attr->{$_};
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   508
+    push(@att,defined($attr->{$_}) ? qq/$key=$quote$value$quote/ : qq/$key/);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   509
     }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   510
     return @att;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   511
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   512
@@ -176,19 +184,19 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   513
     if (EBCDIC) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   514
       $todecode =~ s/%([0-9a-fA-F]{2})/chr $A2E[hex($1)]/ge;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   515
     } else {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   516
-	# handle surrogate pairs first -- dankogai. Ref: http://unicode.org/faq/utf_bom.html#utf16-2
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   517
-	$todecode =~ s{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   518
-			%u([Dd][89a-bA-B][0-9a-fA-F]{2}) # hi
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   519
-		        %u([Dd][c-fC-F][0-9a-fA-F]{2})   # lo
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   520
-		      }{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   521
-			  utf8_chr(
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   522
-				   0x10000 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   523
-				   + (hex($1) - 0xD800) * 0x400 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   524
-				   + (hex($2) - 0xDC00)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   525
-				  )
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   526
-		      }gex;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   527
+    # handle surrogate pairs first -- dankogai. Ref: http://unicode.org/faq/utf_bom.html#utf16-2
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   528
+    $todecode =~ s{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   529
+            %u([Dd][89a-bA-B][0-9a-fA-F]{2}) # hi
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   530
+                %u([Dd][c-fC-F][0-9a-fA-F]{2})   # lo
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   531
+              }{
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   532
+              utf8_chr(
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   533
+                   0x10000 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   534
+                   + (hex($1) - 0xD800) * 0x400 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   535
+                   + (hex($2) - 0xDC00)
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   536
+                  )
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   537
+              }gex;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   538
       $todecode =~ s/%(?:([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   539
-	defined($1)? chr hex($1) : utf8_chr(hex($2))/ge;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   540
+    defined($1)? chr hex($1) : utf8_chr(hex($2))/ge;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   541
     }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   542
   return $todecode;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   543
 }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   544
diff -ur CGI/t/autoescape.t CGI.pm-3.63/t/autoescape.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   545
--- a/cpan/CGI/t/autoescape.t	Mon Mar  4 09:15:24 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   546
+++ b/cpan/CGI.pm-3.63/t/autoescape.t	Fri Nov  9 19:20:03 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   547
@@ -6,6 +6,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   548
 use Test::More tests => 18;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   549
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   550
 use CGI qw/ autoEscape escapeHTML button textfield password_field textarea popup_menu scrolling_list checkbox_group optgroup checkbox radio_group submit image_button button /;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   551
+$CGI::Util::SORT_ATTRIBUTES = 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   552
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   553
 is (button(-name => 'test<'), '<input type="button"  name="test&lt;" value="test&lt;" />', "autoEscape defaults to On");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   554
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   555
Only in CGI.pm-3.63/t: fast.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   556
diff -ur CGI/t/form.t CGI.pm-3.63/t/form.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   557
--- a/cpan/CGI/t/form.t	Mon Mar  4 09:15:24 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   558
+++ b/cpan/CGI.pm-3.63/t/form.t	Wed Aug 15 22:01:10 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   559
@@ -27,7 +27,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   560
 $ENV{SERVER_NAME}     = 'the.good.ship.lollypop.com';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   561
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   562
 is(start_form(-action=>'foobar',-method=>'get'),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   563
-   qq(<form method="get" action="foobar" enctype="multipart/form-data">\n),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   564
+   qq(<form method="get" action="foobar" enctype="multipart/form-data">),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   565
    "start_form()");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   566
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   567
 is(submit(),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   568
@@ -189,28 +189,23 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   569
 $CGI::XHTML = 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   570
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   571
 is(start_form("GET","/foobar"),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   572
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   573
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   574
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   575
     'start_form() + XHTML');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   576
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   577
 is(start_form("GET", "/foobar",&CGI::URL_ENCODED),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   578
-    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   579
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   580
+    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   581
     'start_form() + XHTML + URL_ENCODED');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   582
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   583
 is(start_form("GET", "/foobar",&CGI::MULTIPART),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   584
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   585
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   586
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   587
     'start_form() + XHTML + MULTIPART');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   588
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   589
 is(start_multipart_form("GET", "/foobar"),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   590
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   591
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   592
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   593
     'start_multipart_form() + XHTML');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   594
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   595
 is(start_multipart_form("GET", "/foobar","name=\"foobar\""),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   596
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data" name="foobar">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   597
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   598
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data" name="foobar">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   599
     'start_multipart_form() + XHTML + additional args');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   600
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   601
 # set no XHTML
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   602
@@ -217,28 +212,23 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   603
 $CGI::XHTML = 0;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   604
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   605
 is(start_form("GET","/foobar"),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   606
-    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   607
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   608
+    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   609
     'start_form() + NO_XHTML');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   610
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   611
 is(start_form("GET", "/foobar",&CGI::URL_ENCODED),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   612
-    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   613
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   614
+    qq{<form method="get" action="/foobar" enctype="application/x-www-form-urlencoded">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   615
     'start_form() + NO_XHTML + URL_ENCODED');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   616
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   617
 is(start_form("GET", "/foobar",&CGI::MULTIPART),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   618
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   619
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   620
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   621
     'start_form() + NO_XHTML + MULTIPART');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   622
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   623
 is(start_multipart_form("GET", "/foobar"),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   624
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   625
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   626
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   627
     'start_multipart_form() + NO_XHTML');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   628
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   629
 is(start_multipart_form("GET", "/foobar","name=\"foobar\""),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   630
-    qq{<form method="get" action="/foobar" enctype="multipart/form-data" name="foobar">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   631
-},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   632
+    qq{<form method="get" action="/foobar" enctype="multipart/form-data" name="foobar">},
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   633
     'start_multipart_form() + NO_XHTML + additional args');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   634
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   635
 # restoring value
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   636
diff -ur CGI/t/function.t CGI.pm-3.63/t/function.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   637
--- a/cpan/CGI/t/function.t	Mon Mar  4 09:15:24 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   638
+++ b/cpan/CGI.pm-3.63/t/function.t	Fri Nov  9 19:21:09 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   639
@@ -5,6 +5,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   640
 use Config;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   641
 use CGI (':standard','keywords');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   642
 $loaded = 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   643
+$CGI::Util::SORT_ATTRIBUTES = 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   644
 print "ok 1\n";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   645
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   646
 ######################### End of black magic.
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   647
@@ -103,4 +104,4 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   648
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   649
 test(31, header(-foo=>'bar') eq "Foo: bar${CRLF}Content-Type: text/html${CRLF}${CRLF}", "Custom header");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   650
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   651
-test(32, start_form(-action=>'one',name=>'two',onsubmit=>'three') eq qq(<form method="post" action="one" enctype="multipart/form-data" onsubmit="three" name="two">\n), "initial dash followed by undashed arguments");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   652
+test(32, start_form(-action=>'one',name=>'two',onsubmit=>'three') eq qq(<form method="post" action="one" enctype="multipart/form-data" name="two" onsubmit="three">), "initial dash followed by undashed arguments")
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   653
Only in CGI.pm-3.63/t: gen-tests
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   654
diff -ur CGI/t/headers.t CGI.pm-3.63/t/headers.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   655
--- a/cpan/CGI/t/headers.t	Mon Mar  4 09:15:24 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   656
+++ b/cpan/CGI.pm-3.63/t/headers.t	Wed Nov 14 17:39:38 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   657
@@ -22,6 +22,12 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   658
 like $cgi->header( -type => "text/html".$CGI::CRLF." evil: stuff " ),
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   659
     qr#Content-Type: text/html evil: stuff#, 'known header, with leading and trailing whitespace on the continuation line';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   660
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   661
+eval { $cgi->header( -p3p => ["foo".$CGI::CRLF."bar"] ) };
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   662
+like($@,qr/contains a newline/,'P3P header with CRLF embedded blows up');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   663
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   664
+eval { $cgi->header( -cookie => ["foo".$CGI::CRLF."bar"] ) };
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   665
+like($@,qr/contains a newline/,'Set-Cookie header with CRLF embedded blows up');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   666
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   667
 eval { $cgi->header( -foobar => "text/html".$CGI::CRLF."evil: stuff" ) };
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   668
 like($@,qr/contains a newline/,'unknown header with CRLF embedded blows up');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   669
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   670
diff -ur CGI/t/html.t CGI.pm-3.63/t/html.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   671
--- a/cpan/CGI/t/html.t	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   672
+++ b/cpan/CGI.pm-3.63/t/html.t	Fri Nov  9 19:21:53 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   673
@@ -5,6 +5,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   674
 END { ok $loaded; }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   675
 use CGI ( ':standard', '-no_debug', '*h3', 'start_table' );
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   676
 $loaded = 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   677
+$CGI::Util::SORT_ATTRIBUTES= 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   678
 ok 1;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   679
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   680
 BEGIN {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   681
@@ -98,7 +99,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   682
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   683
 <head>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   684
 <title>The world of foo</title>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   685
-<script src="foo.js" charset="utf-8" type="text/javascript"></script>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   686
+<script charset="utf-8" src="foo.js" type="text/javascript"></script>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   687
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   688
 </head>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   689
 <body>
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   690
Only in CGI.pm-3.63/t: multipart_init.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   691
diff -ur CGI/t/tmpdir.t CGI.pm-3.63/t/tmpdir.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   692
--- a/cpan/CGI/t/tmpdir.t	Mon Mar  4 09:16:21 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   693
+++ b/cpan/CGI.pm-3.63/t/tmpdir.t	Fri Nov  9 19:10:44 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   694
@@ -1,7 +1,11 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   695
 #!perl
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   696
-use Test::More tests => 9;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   697
+use Test::More;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   698
 use strict;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   699
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   700
+if( $> == 0 ) {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   701
+    plan skip_all => "Root can write to 'unwritable files', so many of these tests don't make sense for root.";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   702
+}
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   703
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   704
 my ($testdir, $testdir2);
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   705
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   706
 BEGIN {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   707
@@ -20,21 +24,20 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   708
 CGITempFile->new;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   709
 is($CGITempFile::TMPDIRECTORY, $testdir, "\$CGITempFile::TMPDIRECTORY unchanged");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   710
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   711
-TODO: {
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   712
- local $TODO = "figuring out why these tests fail on some platforms";
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   713
- ok(chmod 0500, $testdir, "revoking write access to $testdir");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   714
- ok(! -w $testdir, "write access to $testdir revoked");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   715
+ok(chmod 0500, $testdir, "revoking write access to $testdir");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   716
+ok(! -w $testdir, "write access to $testdir revoked");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   717
 CGITempFile->new;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   718
 is($CGITempFile::TMPDIRECTORY, $testdir2,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   719
- "unwritable \$CGITempFile::TMPDIRECTORY overridden");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   720
+    "unwritable \$CGITempFile::TMPDIRECTORY overridden");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   721
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   722
 ok(chmod 0500, $testdir2, "revoking write access to $testdir2");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   723
 ok(! -w $testdir, "write access to $testdir revoked");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   724
 CGITempFile->new;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   725
 isnt($CGITempFile::TMPDIRECTORY, $testdir2,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   726
- "unwritable \$ENV{TMPDIR} overridden");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   727
+    "unwritable \$ENV{TMPDIR} overridden");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   728
 isnt($CGITempFile::TMPDIRECTORY, $testdir,
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   729
- "unwritable \$ENV{TMPDIR} not overridden with an unwritable \$CGITempFile::TMPDIRECTORY");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   730
-}
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   731
+    "unwritable \$ENV{TMPDIR} not overridden with an unwritable \$CGITempFile::TMPDIRECTORY");
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   732
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   733
+done_testing();
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   734
+
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   735
 END { for ($testdir, $testdir2) { chmod 0700, $_; rmdir; } }
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   736
diff -ur CGI/t/unescapeHTML.t CGI.pm-3.63/t/unescapeHTML.t
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   737
--- a/cpan/CGI/t/unescapeHTML.t	Mon Mar  4 09:15:24 2013
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   738
+++ b/cpan/CGI.pm-3.63/t/unescapeHTML.t	Wed Aug 15 21:00:12 2012
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   739
@@ -1,4 +1,4 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   740
-use Test::More tests => 4;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   741
+use Test::More tests => 6;
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   742
 use CGI 'unescapeHTML';
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   743
 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   744
 is( unescapeHTML( '&amp;'), '&', 'unescapeHTML: &');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   745
@@ -6,3 +6,7 @@
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   746
 is( unescapeHTML( '&#60;'), '<', 'unescapeHTML: < (using a numbered sequence)'); 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   747
 is( unescapeHTML( 'Bob & Tom went to the store; Where did you go?'), 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   748
     'Bob & Tom went to the store; Where did you go?', 'unescapeHTML: a case where &...; should not be escaped.');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   749
+is( unescapeHTML( 'This_string_contains_both_escaped_&_unescaped_&lt;entities&gt;'), 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   750
+    'This_string_contains_both_escaped_&_unescaped_<entities>', 'unescapeHTML: partially-escaped string.');
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   751
+is( unescapeHTML( 'This escaped string kind of looks like it has an escaped entity &x; it does not'), 
f4d6496d9297 16894331 Problem with utility/perl
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
   752
+    'This escaped string kind of looks like it has an escaped entity &x; it does not', 'unescapeHTML: Another case where &...; should not be escaped.');