Jump to content

v6 Contact Form won't save with HTML for me


Dirty Butter

Recommended Posts

Upgrade from v5.2.16 HAD fully formatted Contact Form document with font colors, sizes, and paragraphs. v6.0.0b6 lost all formatting when I made a slight change and saved. This has happened to me on every beta upgrade, was reported, but CC could not replicate.

 

Need help verifying it's just my install, please. If it is just me, any suggestions?

Link to comment
Share on other sites

Hopefully you have a backup of the CubeCart_config table, and can get the contents from the 'array' column of the "Contact_Form" record.

 

In the file admin/sources/documents.contact.inc.php, make this edit:

Near line 32:
Was:
$data['description'] = base64_encode(stripslashes($data['description']));
 
Now:
$data['description'] = base64_encode(stripslashes($GLOBALS['RAW']['POST']['contact']['description']));

CubeCart 5 maintains a list of POSTed form names that are exempt from getting sanitized (that would strip out any HTML tags).

 

CubeCart 6 keeps a copy of all the data arriving into CubeCart (GET, POST, COOKIE, REQUEST) in another array, $GLOBALS['RAW']. Then sanitizes everything in the real GET, POST, COOKIE, and REQUEST arrays.

 

Therefore, any code that wants to use the form submissions that involve rich text content will need to use the ['RAW'] copy.

 

The admin Contact Form code does not (yet).

Link to comment
Share on other sites

I learn almost all my lessons the hard way, Bsmither. I do have a copy of the whole v5 database, so it was easy to replace. After your edit, I was able to make the edit to Contact and keep my formatting.

This needs to be added to GitHub - I've made so many goofy requests there - can you do it please, Bsmither? You have great cred there LOL.

Link to comment
Share on other sites

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.   Paste as plain text instead

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