*finally* seems to be working under Mason. sheesh.
[freeside.git] / httemplate / config / config-process.cgi
index 2dc4647..50f0d34 100644 (file)
     foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
       if ( $type eq '' ) {
       } elsif ( $type eq 'textarea' ) {
-        if ( $cgi->param($i->key. $n) ) {
-          $conf->set($i->key, $cgi->param($i->key. $n));
+        if ( $cgi->param($i->key. $n) ne '' ) {
+          my $value = $cgi->param($i->key. $n);
+          $value =~ s/\r\n/\n/g; #browsers?
+          $conf->set($i->key, $value);
         } else {
           $conf->delete($i->key);
         }
@@ -25,7 +27,7 @@
           push @delete, $i->key;
         }
       } elsif ( $type eq 'text' )  {
-        if ( $cgi->param($i->key. $n) ) {
+        if ( $cgi->param($i->key. $n) ne '' ) {
           $conf->set($i->key, $cgi->param($i->key. $n));
         } else {
           $conf->delete($i->key);
@@ -41,4 +43,3 @@
 
 %>
 <%= $cgi->redirect("config-view.cgi") %>
-