I am working on this old code and come across this - which fails:
preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject);
He tells me that the preg_replace e modifier is deprecated and uses preg_replace_callback instead.
From what I understand, I have to replace the part 's:'.strlen('$2').':\"$2\";'
with a callback function that does the replacement in the match.
What I DO NOT ALLOW is what the regular expression does, which I will replace. This is part of a bit to accept php serialized data filled in a database field (dumb, I know ...) with broken length fields and correct them for re-entry.
So can someone explain what this bit is doing, or what should I replace?
source
share