summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 23:24:17 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 23:24:17 +0200
commit52c568cc5617a2bca496350b1c61403b486e3bc9 (patch)
tree83bffee2daebf9bce2c769b909919c3a7906c5f5 /Bugzilla
parentb0edd0ea304eb0b8a31972f4d556ccc4fe644003 (diff)
downloadbugzilla-52c568cc5617a2bca496350b1c61403b486e3bc9.tar.gz
bugzilla-52c568cc5617a2bca496350b1c61403b486e3bc9.tar.xz
Bug 553923: Don't word-wrap messages and errors for the WebService
r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Template.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 618af4726..639088984 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -680,10 +680,18 @@ sub create {
$var =~ s/\&gt;/>/g;
$var =~ s/\&quot;/\"/g;
$var =~ s/\&amp;/\&/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;
},