From: Max Kanat-Alexander Date: Sun, 28 Mar 2010 21:24:17 +0000 (-0700) Subject: Bug 553923: Don't word-wrap messages and errors for the WebService X-Git-Tag: bugzilla-3.7.1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52c568cc5617a2bca496350b1c61403b486e3bc9;p=thirdparty%2Fbugzilla.git Bug 553923: Don't word-wrap messages and errors for the WebService r=dkl, a=mkanat --- diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 618af4726a..6390889849 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -680,10 +680,18 @@ sub create { $var =~ s/\>/>/g; $var =~ s/\"/\"/g; $var =~ s/\&/\&/g; - # Now remove extra whitespace, and wrap it to 72 characters. + # Now remove extra whitespace... my $collapse_filter = $Template::Filters::FILTERS->{collapse}; $var = $collapse_filter->($var); - $var = wrap_comment($var, 72); + # And if we're not in the WebService, wrap the message. + # (Wrapping the message in the WebService is unnecessary + # and causes awkward things like \n's appearing in error + # messages in JSON-RPC.) + unless (Bugzilla->usage_mode == USAGE_MODE_JSON + or Bugzilla->usage_mode == USAGE_MODE_XMLRPC) + { + $var = wrap_comment($var, 72); + } return $var; },