[24-Jul-2026 04:45:43 Pacific/Auckland] PHP Warning: Uninitialized string offset 0 in /home/serv/public_html/mailwatch/mailscanner/lib/pear/Mail/mimeDecode.php on line 483
function _parseHeaders($input)
{
$return = [];
if ($input !== '') {
// Unfold the input
$input = preg_replace("/\r?\n/", "\r\n", $input);
$input = preg_replace("/=\r\n(\t| )+/", '=', $input);
$input = preg_replace("/\r\n(\t| )+/", ' ', $input);
$headers = explode("\r\n", trim($input));
$got_start = false;
foreach ($headers as $value) {
if (!$got_start) {
// munge headers for mbox style from
if (!empty($value) && $value[0] == '>') {
$value = substr($value, 1); // remove mbox >
}
if (substr($value, 0, 5) == 'From ') {
$value = 'Return-Path: ' . substr($value, 5);
} else {
$got_start = true;
}
}
$pos = strpos($value, ':');
if ($pos !== false) {
$hdr_name = substr($value, 0, $pos);
$hdr_value = substr($value, $pos + 1);
if (!empty($hdr_value) && $hdr_value[0] == ' ') {
$hdr_value = substr($hdr_value, 1);
}
$return[] = [
'name' => $hdr_name,
'value' => $hdr_value,
];
}
}
}
return $return;
}
[24-Jul-2026 04:45:43 Pacific/Auckland] PHP Warning: Uninitialized string offset 0 in /home/serv/public_html/mailwatch/mailscanner/lib/pear/Mail/mimeDecode.php on line 483
the fix