diff options
author | Byron Jones <bjones@mozilla.com> | 2013-03-12 17:01:27 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-03-12 17:01:27 +0100 |
commit | f9b2e1368014673803a5684f9ae3c2e1e0628853 (patch) | |
tree | becdf248c603bfec5b5d4421757f6181a72c4555 | |
parent | 8e7e0ebcde79e5cd357c2644933d7bba23b03f28 (diff) | |
download | bugzilla-f9b2e1368014673803a5684f9ae3c2e1e0628853.tar.gz bugzilla-f9b2e1368014673803a5684f9ae3c2e1e0628853.tar.xz |
Bug 839357: bugmail syslog logging is throwing "Wide character in syswrite"
-rw-r--r-- | extensions/BMO/Extension.pm | 5 |
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(); } |