Jump to content

htmlentites


kaliok

Recommended Posts

I am having some problems with a site I created some time ago. I haven't worked on the code in a few months, but it was working fine up until a few weeks ago. The code has not been changed at all.

 

I believe the problem lies with the host company, it looks like they recently upgraded their version of PHP to 5.2.6.

 

I noticed the changes made for this version to htmlentities mention the following:

 

Fixed htmlentities/htmlspecialchars not to accept partial multibyte sequences.

 

But I don't know what that means.

 

The problem I found was that htmlentities completed blanked out the text that is put into it.

 

As I said the following worked fine until a week or so ago:

 

$testX=htmlentities($paragraph,ENT_QUOTES,"utf-8");

 

I played with it a bit and it works if I do this:

 

$testX=htmlentities($paragraph);

 

BUT this didn't work:

 

$testX=htmlentities($paragraph,ENT_QUOTES);

 

So I believe I am correct in stating that the problem lies specifically with the optional 2nd element of the function. But I don't know why??

 

I would still like to have it changing both types of quote, and not have to go through the entire site changing the problem code.

 

Could someone suggest what the problem is please?

 

The meta data of the page DOES set the content-type to UTF-8 if that helps.

 

Could the problem lie with the host incorrectly or deliberately installing the new version of PHP incorrectly?

 

Any help is greatly appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/106052-htmlentites/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.