break;
case '{':
/* process the literal value */
- $arg_s = $this->parseLiteral($read, $i);
+ $arg_a[] = $this->parseLiteral($read, $i);
++$arg_no;
break;
case '0':
$arg_a[] = $this->parseLiteral($read, $i);
/* temp bugfix (SM 1.5 will have a working clean version)
too much work to implement that version right now */
- --$i;
+// --$i;
++$arg_no;
break;
case 'N':
$hdr->date = getTimeStamp($d); /* argument 1: date */
$hdr->subject = $arg_a[1]; /* argument 2: subject */
- $hdr->from = $arg_a[2][0]; /* argument 3: from */
- $hdr->sender = $arg_a[3][0]; /* argument 4: sender */
- $hdr->replyto = $arg_a[4][0]; /* argument 5: reply-to */
+ $hdr->from = is_array($arg_a[2]) ? $arg_a[2][0] : ''; /* argument 3: from */
+ $hdr->sender = is_array($arg_a[3]) ? $arg_a[3][0] : ''; /* argument 4: sender */
+ $hdr->replyto = is_array($arg_a[4]) ? $arg_a[4][0] : ''; /* argument 5: reply-to */
$hdr->to = $arg_a[5]; /* argument 6: to */
$hdr->cc = $arg_a[6]; /* argument 7: cc */
$hdr->bcc = $arg_a[7]; /* argument 8: bcc */
/* Now read the literal */
$s = ($lit_cnt ? substr($read,$i,$lit_cnt): '');
$i += $lit_cnt;
+ /* temp bugfix (SM 1.5 will have a working clean version)
+ too much work to implement that version right now */
+ --$i;
} else { /* should never happen */
$i += 3; /* } + \r + \n */
$s = '';
$iPos = ++$i;
while (true) {
$iPos = strpos($read,'"',$iPos);
- if ($iPos === false) break;
+ if (!$iPos) break;
if ($iPos && $read{$iPos -1} != '\\') {
$s = substr($read,$i,($iPos-$i));
$i = $iPos;
break;
}
+ $iPos++;
+ if ($iPos > strlen($read)) {
+ break;
+ }
}
return $s;
}