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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fgunni at 01019freenet dot de
New email:
PHP Version: OS:

 

 [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 Jul 25 18:01:30 2024 UTC