use is_serialized() instead of is_string()#170
Closed
ideag wants to merge 7531 commits intowp-cli:masterfrom
Closed
use is_serialized() instead of is_string()#170ideag wants to merge 7531 commits intowp-cli:masterfrom
ideag wants to merge 7531 commits intowp-cli:masterfrom
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>
danielbachhuber
requested changes
Aug 25, 2022
src/WP_CLI/SearchReplacer.php
Outdated
| } | ||
|
|
||
| $unserialized = is_string( $data ) ? @unserialize( $data ) : false; | ||
| $unserialized = is_serialized( $data ) ? @unserialize( $data ) : false; |
Member
There was a problem hiding this comment.
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.
Member
There was a problem hiding this comment.
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
Member
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #122 - serialization warnings in PHP 8.*