Closed nickdaugherty closed 2 years ago
I'm getting the same. Started when I upgraded to PHP8.
Getting the same error on PHP8 as well, which I resolved by replacing the is_string($data)
check with the significantly more robust WP Core function is_serialized($data)
. Does anyone know of a reason this wouldn't be a good change?
The reported bug was fixed via https://github.com/wp-cli/search-replace-command/commit/d7a6a73fcddd80ca8953fb32269fb36aae934851
Bug Report
Describe the current, buggy behavior
Additionally, this results in warnings like this:
Describe how other contributors can replicate this bug
I'm not 100% sure the conditions that trigger this, we've just noticed it while running search/replaces like this:
Describe what you would expect as the correct outcome
No suppressed warnings because only strings get passed into
unserialize()
.Let us know what environment you are running this on
Provide a possible solution
This bug was introduced here:
https://github.com/wp-cli/search-replace-command/commit/babbfbfcc1d36aff2f8b54f7b491bded98bde5d3
It would seem that while trying to address PHPCS styles, the logic was changed.
Was:
Is now:
The
is_string()
check needs to happen beforeunserialize()
is called, not after.