Skip to content

Commit

Permalink
Call parseRawBody() in Webklex Message if body has not been parsed yet
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Aug 13, 2024
1 parent 310d329 commit 823014d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions overrides/webklex/php-imap/src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ public function hasTextBody(): bool {
* @return mixed
*/
public function getTextBody() {
if (!$this->structure) {
$this->parseRawBody($this->tmp_raw_body);
}
if (!isset($this->bodies['text'])) {
return null;
}
Expand All @@ -385,6 +388,9 @@ public function getTextBody() {
* @return bool
*/
public function hasHTMLBody(): bool {
if (!$this->structure) {
$this->parseRawBody($this->tmp_raw_body);
}
return isset($this->bodies['html']) && $this->bodies['html'] !== "";
}

Expand All @@ -394,6 +400,9 @@ public function hasHTMLBody(): bool {
* @return string|null
*/
public function getHTMLBody() {
if (!$this->structure) {
$this->parseRawBody($this->tmp_raw_body);
}
if (!isset($this->bodies['html'])) {
return null;
}
Expand Down

0 comments on commit 823014d

Please sign in to comment.