-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use is_serialized() instead of is_string() #170
Conversation
…porting Update scaffolded tests to enable error reporting
* Regenerates README.md * Adds `.github/settings.yml` for description and label management. * Updates `.github/PULL_REQUEST_TEMPLATE`
Update scaffolded README and GitHub configuration
Restrict some search-replace tests to wp_posts to avoid wp_options cl…
Add `--skip-tables=<tables>` argument to exclude tables when performing search-replace
Remove unnecessary `array_diff()`; skipping within loop is clearer
Convert search-replace subcommand help summaries to use third-person singular verbs.
Adapt feature test to use HTTPS with example.com
Will confirm that it resolved #122 for me and works as intended. |
Co-authored-by: Daniel Bachhuber <daniel@bachhuber.co>
src/WP_CLI/SearchReplacer.php
Outdated
@@ -83,7 +83,7 @@ private function run_recursively( $data, $serialised, $recursion_level = 0, $vis | |||
} | |||
} | |||
|
|||
$unserialized = is_string( $data ) ? @unserialize( $data ) : false; | |||
$unserialized = is_serialized( $data ) ? @unserialize( $data ) : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally seems fine. Could we get a test case for it?
Also, let's internalize is_serialized()
to a private method on this class. As far as I can tell, we don't have any other WordPress-specific dependencies in this class, so better to keep things that way for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, during a search-replace
, WP might potentially be broken, so it's best to copy the function over.
…unserialize Add further suppression of warnings and notices
Fixes wp-cli#112 - serialization warnings in PHP 8.*
dc379db
to
a758b68
Compare
Proceeding with wp-cli/wp-cli#5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/6c429bfdd43cae3ddb72559ad1f54446 in case this PR is auto-closed or broken in some way. |
288c656
to
fa755eb
Compare
Fixes #122 - serialization warnings in PHP 8.*