summaryrefslogtreecommitdiffstats
path: root/extensions/BMO
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-03-12 17:01:27 +0100
committerByron Jones <bjones@mozilla.com>2013-03-12 17:01:27 +0100
commitf9b2e1368014673803a5684f9ae3c2e1e0628853 (patch)
treebecdf248c603bfec5b5d4421757f6181a72c4555 /extensions/BMO
parent8e7e0ebcde79e5cd357c2644933d7bba23b03f28 (diff)
downloadbugzilla-f9b2e1368014673803a5684f9ae3c2e1e0628853.tar.gz
bugzilla-f9b2e1368014673803a5684f9ae3c2e1e0628853.tar.xz
Bug 839357: bugmail syslog logging is throwing "Wide character in syswrite"
Diffstat (limited to 'extensions/BMO')
-rw-r--r--extensions/BMO/Extension.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index e40e4eb15..8cd722547 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -40,7 +40,7 @@ use Bugzilla::Util;
use Scalar::Util qw(blessed);
use Date::Parse;
use DateTime;
-use Encode qw(find_encoding decode_utf8);
+use Encode qw(find_encoding encode_utf8);
use Sys::Syslog qw(:DEFAULT setlogsock);
use Bugzilla::Extension::BMO::Constants;
@@ -936,12 +936,13 @@ sub _log_sent_email {
} else {
$message_type = $email->header('X-Bugzilla-Watch-Reason');
}
+ $message_type =~ s/^(\S+)\s.+$/$1/;
$message_type ||= '?';
$subject =~ s/[\[\(]Bug \d+[\]\)]\s*//;
openlog('apache', 'cons,pid', 'local4');
- syslog('notice', decode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject"));
+ syslog('notice', encode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject"));
closelog();
}