I have this function in my application:
public function direct($theTree) { $aTreeRoot = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $theTree); return unserialize($aTreeRoot); }
It should never return false, but the error is saved in the error logs, which says that it returns false.
However, I cannot reproduce the error in my application. I try my best, but it always works.
Is there something wrong with the function?
$theTree comes from a session.
Edit: A regex exists because: unserialize - Find my regex there in the comments. He must solve the problem.
source share