Jump to content

htmlentities - entities automatically decode after POST?


rocksfrow

Recommended Posts

Hi,

 

I just built a mailing application that passes the content of the mailing (a full html page) via POST a couple times before mailing.

 

I noticed as I was building it that the entities that were encoded by htmlentities() were automatically decoded once I was handling them after POST. I'm simply verifying that this is STANDARD. Basically just making sure that I don't need to html_entity_decode() before sending the mailing because it's automatically done after POST. I have it setup this way currently and it's working perfect, just looking for a solid explanation to make sure one day somebody doesn't send a mailing out with a bunch of encoded entities in it!

 

Thanks much!

 

Link to comment
Share on other sites

Let me give more information so I get a better response.

 

1. First step get email content using: $content = file_get_contents(url);

2. htmlentities($content); inserted into a hidden input element

3. Another confirmation that puts the same content into another hidden element, but the entities are being decoded automatically after posting so i use: htmlentities(stripslashes($_POST['content']));

4. Send the mailing, doing nothing to content except stripslashes();

 

Would you say this is safe/accurate?

 

Thanks much for your help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.