Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Mail/mimePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public function encode($boundary = null)
for ($i = 0; $i < count($this->subparts); $i++) {
$encoded['body'] .= '--' . $boundary . $eol;
$tmp = $this->subparts[$i]->encode();
if (is_a($tmp, 'PEAR_Error')) {
if ($tmp instanceof PEAR_Error) {
return $tmp;
}
foreach ($tmp['headers'] as $key => $value) {
Expand All @@ -375,7 +375,7 @@ public function encode($boundary = null)
@ini_set('magic_quotes_runtime', $magic_quotes);
}

if (is_a($body, 'PEAR_Error')) {
if ($body instanceof PEAR_Error) {
return $body;
}
$encoded['body'] = $body;
Expand Down Expand Up @@ -433,7 +433,7 @@ public function encodeToFile($filename, $boundary = null, $skip_head = false)
@ini_set('magic_quotes_runtime', $magic_quotes);
}

return is_a($res, 'PEAR_Error') ? $res : $this->headers;
return $res instanceof PEAR_Error ? $res : $this->headers;
}

/**
Expand Down Expand Up @@ -472,7 +472,7 @@ protected function encodePartToFile($fh, $boundary = null, $skip_head = false)
for ($i = 0; $i < count($this->subparts); $i++) {
fwrite($fh, $f_eol . '--' . $boundary . $eol);
$res = $this->subparts[$i]->encodePartToFile($fh);
if (is_a($res, 'PEAR_Error')) {
if ($res instanceof PEAR_Error) {
return $res;
}
$f_eol = $eol;
Expand All @@ -487,7 +487,7 @@ protected function encodePartToFile($fh, $boundary = null, $skip_head = false)
$res = $this->getEncodedDataFromFile(
$this->body_file, $this->encoding, $fh
);
if (is_a($res, 'PEAR_Error')) {
if ($res instanceof PEAR_Error) {
return $res;
}
}
Expand Down
Loading