From 4c3068ee06914665fc630d2fa7a8215e6bc60eaf Mon Sep 17 00:00:00 2001
From: "dave%intrec.com" <>
Date: Fri, 29 Sep 2000 12:29:09 +0000
Subject: Fix for bug 44076: Editparams falsely detecting text field changes
and NS4Mac putting a single linefeed in empty fields.
---
doeditparams.cgi | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/doeditparams.cgi b/doeditparams.cgi
index cc7b66107..148946fef 100755
--- a/doeditparams.cgi
+++ b/doeditparams.cgi
@@ -51,7 +51,8 @@ foreach my $i (@::param_list) {
if (exists $::FORM{"reset-$i"}) {
$::FORM{$i} = $::param_default{$i};
}
- $::FORM{$i} =~ s/\r\n/\n/; # Get rid of windows-style line endings.
+ $::FORM{$i} =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
+ $::FORM{$i} =~ s/^\n$//; # assume single linefeed is an empty string
if ($::FORM{$i} ne Param($i)) {
if (defined $::param_checker{$i}) {
my $ref = $::param_checker{$i};
@@ -64,6 +65,8 @@ foreach my $i (@::param_list) {
}
}
print "Changed $i.
\n";
+# print "Old: '" . url_quote(Param($i)) . "'
\n";
+# print "New: '" . url_quote($::FORM{$i}) . "'
\n";
$::param{$i} = $::FORM{$i}
}
}
--
cgit v1.2.1