<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>broken php htmlspecialchars workaround needed</title> 
  <pubDate>Fri, 10 Apr 2026 20:05:43 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7305</link> 
  <atom:link rel="self" type="application/rss+xml" title="broken php htmlspecialchars workaround needed" href="https://bugs.horde.org/ticket/7305/rss" /> 
  <description>broken php htmlspecialchars workaround needed</description> 
 
   
   
  <item> 
   <title>php htmlspecialchars function is stupid: When presented with</title> 
   <description>php htmlspecialchars function is stupid: When presented with invalid character data (e.g. raw latin1 &#039;ä&#039;) and encoding is set to utf-8 (also possibly other multibyte encodings), htmlspecialchars returns empty string (http://bugs.php.net/bug.php?id=43896).



horde should compensate for this, as not showing anything in an email when it contains broken utf-8 data is just plain wrong.



So, before using htmlspecialchars with charset utf-8, data should be checked that it is (at least) valid utf-8.



Not sure if this is horde or imp bug. In our local installation I fixed the problem with attached patch to lib/Horde/Text/Filter/text2html.php. We get a lot of messages with broken utf-8, unfortunately.

</description> 
   <pubDate>Mon, 08 Sep 2008 14:56:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7305#t48773</link> 
  </item> 
   
  <item> 
   <title>This is a bug in PHP. Period. This is going to break tons of</title> 
   <description>This is a bug in PHP. Period. This is going to break tons of sites with user submitted content.</description> 
   <pubDate>Mon, 08 Sep 2008 15:27:48 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7305#t48774</link> 
  </item> 
   
  <item> 
   <title>Please reconsider.



If I understand correctly, according t</title> 
   <description>Please reconsider.



If I understand correctly, according to comment &quot;[18 Jul 12:10am UTC] moriyoshi at php.net&quot; php developers does not consider this to be a php bug or even consider fixing this in php. So, the application calling htmlspecialchars need to check that input is valid utf-8 (when using utf-8 charset argument).



</description> 
   <pubDate>Wed, 10 Sep 2008 09:58:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7305#t48829</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
