php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60210 [DE] Example is not correct, as german Umlaut gets also encoded
Submitted: 2011-11-03 13:04 UTC Modified: 2011-11-03 13:17 UTC
From: fgunni at 01019freenet dot de Assigned: raphaelm (profile)
Status: Closed Package: Translation problem
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
 [2011-11-03 13:04 UTC] fgunni at 01019freenet dot de
Description:
------------
---
From manual page: http://www.php.net/function.htmlentities#refsect1-function.htmlentities-examples
---
Umlaut (ü => ü) also gets encoded.

Wrong:
<?php
$str = "Ein 'Anführungszeichen' ist <b>fett</b>";

// Gibt aus: Ein 'Anführungszeichen' ist &lt;b&gt;fett&lt;/b&gt;
echo htmlentities($str);

// Gibt aus: Ein &#039;Anführungszeichen&#039; ist &lt;b&gt;fett&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
?>
Correct:
<?php
$str = "Ein 'Anführungszeichen' ist <b>fett</b>";

// Gibt aus: Ein 'Anf&uuml;hrungszeichen' ist &lt;b&gt;fett&lt;/b&gt;
echo htmlentities($str);

// Gibt aus: Ein &#039;Anf&uuml;hrungszeichen&#039; ist &lt;b&gt;fett&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-03 13:09 UTC] raphaelm@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: raphaelm
 [2011-11-03 13:09 UTC] raphaelm@php.net
-Summary: Example is not correct, as german Umlaut gets also encoded +Summary: [DE] Example is not correct, as german Umlaut gets also encoded
 [2011-11-03 13:15 UTC] raphaelm@php.net
Automatic comment from SVN on behalf of raphaelm
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=318735
Log: Doc Bugs #55803 and #60210 fixed.
 [2011-11-03 13:17 UTC] raphaelm@php.net
-Status: Assigned +Status: Closed
 [2011-11-03 13:17 UTC] raphaelm@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC