diff --git a/api/src/Mail/Html.php b/api/src/Mail/Html.php index ceb7ff0c34..63efa8db7d 100644 --- a/api/src/Mail/Html.php +++ b/api/src/Mail/Html.php @@ -555,7 +555,9 @@ class Html $html2ret[] = substr($html,0,$pos); while ($pos!==false) { - $endofpre = stripos($html,'',$pos); + // 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)); $length = $endofpre-$pos+6; $html2ret[] = substr($html,$pos,$length); $searchFor = '