trim whitespace for domain field in svc_domain prov UI, RT11432
authorlevinse <levinse>
Mon, 21 Feb 2011 06:03:09 +0000 (06:03 +0000)
committerlevinse <levinse>
Mon, 21 Feb 2011 06:03:09 +0000 (06:03 +0000)
httemplate/edit/process/svc_domain.cgi

index 381339b..a5c617d 100755 (executable)
@@ -46,6 +46,11 @@ my $new = new FS::svc_domain ( {
   } ( fields('svc_domain'), qw( pkgnum svcpart action ) )
 } );
 
+# trim leading and trailing whitespace to avoid errors caused by pasting into UI
+my $domain = $new->domain;
+$domain =~ s/^\s+|\s+$//g;
+$new->domain($domain);
+
 my $error = '';
 if ($cgi->param('svcnum')) {
   $error  = $new->replace();