diff --git a/api/src/Mail/Html.php b/api/src/Mail/Html.php index 470e871ae6..b8b55e08cf 100644 --- a/api/src/Mail/Html.php +++ b/api/src/Mail/Html.php @@ -564,7 +564,11 @@ class Html { // avoid infinit loop in case the endof pre can't be found, just give the // end position to return the rest of content as return html - $endofpre = (stripos($html,'',$pos) === false ? strlen($html) : stripos($html,'',$pos)); + if (($endofpre = stripos($html, '', $pos)) === false) + { + $html2ret[] = substr($html, $pos); + break; + } $length = $endofpre-$pos+6; $html2ret[] = substr($html,$pos,$length); $searchFor = '