From: mark Date: Tue, 5 Oct 2010 17:32:24 +0000 (+0000) Subject: prevent broken custom field values, RT#9959 X-Git-Tag: TORRUS_1_0_9~239 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=6889413a55f87e4b7f6b6637773f87a0de52b3b4;hp=e94bccb7296ad6c884005b6beb24a1c2716314a2 prevent broken custom field values, RT#9959 --- diff --git a/rt/share/html/Admin/CustomFields/Modify.html b/rt/share/html/Admin/CustomFields/Modify.html index d2932d2d9..fc2c49d59 100644 --- a/rt/share/html/Admin/CustomFields/Modify.html +++ b/rt/share/html/Admin/CustomFields/Modify.html @@ -199,6 +199,15 @@ if ( $ARGS{'Update'} && $id ne 'new' ) { 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 @@ if ( $ARGS{'Update'} && $id ne 'new' ) { 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);