[web-news] master: Fix bug in handling of HTML messages

From: Date: Mon, 02 Sep 2024 20:11:04 +0000
Subject: [web-news] master: Fix bug in handling of HTML messages
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-32056@lists.php.net to get a copy of this message
Author: Jim Winstead (jimwins) Date: 2024-09-02T13:09:28-07:00 Commit: https://github.com/php/web-news/commit/0e68ca6e459f5779a62fd8edd513912a43f2fc95 Raw diff: https://github.com/php/web-news/commit/0e68ca6e459f5779a62fd8edd513912a43f2fc95.diff Fix bug in handling of HTML messages Changed paths: M article.php Diff: diff --git a/article.php b/article.php index a617e58..d944049 100644 --- a/article.php +++ b/article.php @@ -133,7 +133,7 @@ // This makes HTML from Fastmail retain paragraph breaks $text = preg_replace('#<div><br></div>#', "\n\n", $mail['html']); // And this avoids extra linebreaks from another example (Android?) - $text = preg_replace("#\n<br>\n#", "\n", $mail['html']); + $text = preg_replace("#\n<br>\n#", "\n", $text); $mail['text'] = html_entity_decode(strip_tags($text), encoding: 'UTF-8'); } else { $mail['text'] = "> There was no text content in this message.";

« previous php.webmaster (#32056) next »