[freeside-commits] freeside/rt/share/html/Admin/CustomFields Modify.html, 1.2, 1.3

Mark Wells mark at wavetail.420.am
Tue Oct 5 10:32:26 PDT 2010


Update of /home/cvs/cvsroot/freeside/rt/share/html/Admin/CustomFields
In directory wavetail.420.am:/tmp/cvs-serv9194/CustomFields

Modified Files:
	Modify.html 
Log Message:
prevent broken custom field values, RT#9959

Index: Modify.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/share/html/Admin/CustomFields/Modify.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- Modify.html	1 Sep 2010 23:39:23 -0000	1.2
+++ Modify.html	5 Oct 2010 17:32:24 -0000	1.3
@@ -199,6 +199,15 @@
         push (@results, $msg);
     }
 
+    # Clean up values
+    foreach my $param (grep /^$paramtag-/, keys(%ARGS)) {
+      for ($ARGS{$param}) {
+        s/\r+\n/\n/g;
+        s/^\s+//;
+        s/\s+$//;
+      }
+    }
+
     # Update any existing values
     my $values = $CustomFieldObj->ValuesObj;
     while ( my $value = $values->Next ) {
@@ -206,7 +215,6 @@
             my $param = join("-", $paramtag, $value->Id, $attr);
             next unless exists $ARGS{$param};
             next if ($value->$attr()||'') eq ($ARGS{$param}||'');
-
             my $mutator = "Set$attr";
             my ($id, $msg) = $value->$mutator( $ARGS{$param} );
             push (@results, $msg);



More information about the freeside-commits mailing list