wrong variable in session library |
|||
|---|---|---|---|
| Date: | 10/18/2008 | Severity: | Critical |
| Status: | Resolved | Reporter: | Bramme |
| Version: | 1.7.0 SVN | ||
| Keywords: | Libraries, Session Class | ||
Description
When autoloading the session class, i got an error that a certain variable did not exist. Went to look up the function and found a typo. Trew a bunch of errors though, causing my page not to load.
Code Sample
/**
* Unserialize
*
* This function unserializes a data string, then converts any
* temporary slash markers back to actual slashes
*
* @access private
* @param array
* @return string
*/
function _unserialize($data)
{
$data = @unserialize(strip_slashes($data));
if (is_array($data))
{
foreach ($data as $key => $val)
{
$data[$key] = str_replace('{{slash}}', '\\', $str);
}
return $data;
}
return str_replace('{{slash}}', '\\', $data);
}
Expected Result
$data[$key] = str_replace(’{{slash}}’, ‘\\’, $val);
Actual Result
$data[$key] = str_replace(’{{slash}}’, ‘\\’, $str);
