HTML entities being converted

Permalink Browser Info Environment
Hi,

When getting my PHP block to output a price in GBP I get type into the window that it should print the output as
 
or as
£


Instead of either of those being outputted, I get the the actual pound symbol.

Is there a way to stop this from happening?

Thanks, Steve

Type: Discussion
Status: New
shadowcomputers
View Replies:
elyon replied on at Permalink Reply
elyon
As far as I can tell, the code is being saved directly to the database, then is being eval'ed in order to display it on the page.

I'm not sure if this is being caused by the script that saves data to the database, or if this is caused by PHP's eval() method.

You could try surrounding the content that you enter in the PHP block with htmlentities(). When eval'ed, it should instruct it to convert characters like this to the applicable HTML entity.
shadowcomputers replied on at Permalink Reply
shadowcomputers
Hi,

I have checked the database - when I enter the HTML entity, it stores it as typed.

But when viewing the source code it shows as the Pound symbol.

Also, if I go to edit the PHP block again it gets converted in the window.

Surrounding it with the htmlentities() did produced the same problems.

Many thanks, Steve

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.