Greetings:
So, I've got a real problem in that PHP doesn't seem to be able to
unserialize() an array that has an element containing a newline. Of
course, I've used htmlentities() to protect the serialized data.
Here's a simple example that demonstrates the problem:
-----
<?php
$blah = array("I like\nnewlines");
echo '<html>';
echo '<body>';
if (isset($_POST['blah'])) {
if (unserialize(html_entity_decode($_POST['blah'])) === FALSE)
echo '<p>Unserialize failed.</p>';
else
echo '<p>Unserialize worked.</p>';
}
echo '<form method="POST" enctype="multipart/form-data"
action="test.php">';
echo '<input type="hidden"';
echo ' name="blah"';
echo ' value="';
echo htmlentities(serialize($blah));
echo '"';
echo '/>';
echo '<input type="submit" name="doink" value="Submit" />';
echo '</form>';
echo '</body>';
echo '</html>';
?>