$this->_newSpool($group, $this->profile['display'], $this->profile['lastnews']);
$body = preg_replace("/\n\.[ \t\r]*\n/m", "\n..\n", $_POST['body']);
- $msg = 'From: '.$this->profile['name']."\n"
+ $msg = 'From: '.headerEncode($this->profile['name'])."\n"
. "Newsgroups: ".$_POST['newsgroups']."\n"
- . "Subject: ".$_POST['subject']."\n"
+ . "Subject: ".headerEncode($_POST['subject'], 128)."\n"
. (empty($this->profile['org']) ? '' : "Organization: {$this->profile['org']}\n")
. (empty($_POST['followup']) ? '' : 'Followup-To: '.$_POST['followup']."\n");
return preg_replace('/=\?([^?]*)\?([BQ])\?([^?]*)\?=/e', '_headerdecode("\1", "\2", "\3")', $val);
}
+function headerEncode($value, $trim = 0) {
+ if ($trim) {
+ $value = substr($value, $trim) . "[...]";
+ }
+ return "=?UTF-8?B?".base64_encode($value)."?=";
+}
+
function header_translate($hdr) {
switch ($hdr) {
case 'from': return _b_('De');