php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67545 htmlentities is not working
Submitted: 2014-06-30 11:25 UTC Modified: 2014-06-30 14:44 UTC
From: benedict dot poppe at neuberger dot net Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.5.14 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 - 1 = ?
Subscribe to this entry?

 
 [2014-06-30 11:25 UTC] benedict dot poppe at neuberger dot net
Description:
------------
I have an webspace account with PHP 5.5 on www.hetzner.de.

If i use the function "htmlentities", define a variable with htmlcode and commit the var as function- parameter, nothing happens.

I start error_reporting, but no errors are displayed. 

If i use the htmlentities function twice on an var, i see the correct output. 
I tested it with different character sets and flags.

See my testscript.

The problem appears on an local linux ubuntu server with PHP Version 5.3.2-1ubuntu4.25

and on my webspace account with PHP Version 5.5

Test script:
---------------
This Example -->> doesn't <<-- work on my system: 

$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);



This Example -->> work <<-- on my system: 


$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities(htmlentities($str));





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-30 14:44 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2014-06-30 14:44 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

User your browser's "view source" feature (Ctrl+U) or a command line PHP to see what happens.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC