V2.0 Bug: address2 and address3 get <BR> appended to data

From: Gregory Neil Shapiro (gshapiro@retsiger.com)
Date: Thu Apr 13 2000 - 08:41:26 EDT


Version 2.0 appends <BR> to {owner,billing,tech}_address{2,3} if they have
information when presenting to for the verify template. Unfortunately, it
changes the *registration* data instead of the HTML display data. This
results in all registrations coming through with <BR>'s on those lines.

The patch below fixes this problem by keeping %in separate from %HTML (note
the change in chunk 2). To do this, if copying billing information, we
need to copy $in information as well (chunk 1). Chunks 3 & 4 fix the tech
info munging.

--- reg_system.cgi 2000/04/13 06:52:16 1.10
+++ reg_system.cgi 2000/04/13 07:08:07
@@ -212,6 +212,7 @@
         foreach $key (keys %in) {
             if ($key =~ /^billing_(.+)$/) {
                 $HTML{$key} = $in{"owner_$1"};
+ $in{$key} = $in{"owner_$1"};
             }
         }
     }
@@ -259,7 +260,7 @@
 
     foreach $type (@contact_types) {
         foreach $field (qw(first_name last_name org_name address1 address2 address3 city state postal_code country email phone fax)) {
- $HTML{CONTACT_INFO} .= "<input type=hidden name=\"$type" . "_$field\" value=\"" . encode($HTML{$type . "_$field"}) . "\">\n";
+ $HTML{CONTACT_INFO} .= "<input type=hidden name=\"$type" . "_$field\" value=\"" . encode($in{$type . "_$field"}) . "\">\n";
         }
     }
 
@@ -1075,9 +1076,6 @@
 
     my $data = shift;
 
- if ($data->{tech_address2}) { $data->{tech_address2} .= "<br>\n" }
- if ($data->{tech_address3}) { $data->{tech_address3} .= "<br>\n" }
-
     my $html = <<EOF;
 <tr><td colspan=2 align=center><b>Tech Contact Information</b></td></tr>
 
@@ -1086,8 +1084,14 @@
 $data->{tech_first_name} $data->{tech_last_name}<BR>
 $data->{tech_org_name}<BR>
 $data->{tech_address1}<BR>
-$data->{tech_address2}
-$data->{tech_address3}
+EOF
+
+ $html .= "$data->{tech_address2}";
+ if ($data->{tech_address2}) { $html .= "<br>\n"; }
+ $html .= "$data->{tech_address3}";
+ if ($data->{tech_address3}) { $html .= "<br>\n"; }
+
+ $html .= <<EOF;
 $data->{tech_city}, $data->{tech_state} $data->{tech_postal_code}<BR>
 $data->{tech_country}
 </td>



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:35:27 EDT