From e8c352acbd72068faa48f79cd0ce4a3630112d72 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Nov 2021 11:38:49 +0100 Subject: [PATCH] fix PHP 8.0 ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- api/src/Mail/Html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = '