Skip to content
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

Skip search and replace on objects that can't deserialize safely #192

Merged
merged 26 commits into from
Dec 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aff9a8f
skip deserialization of S&R objects that return TypeErrors
MarkBerube Nov 27, 2023
4ef93f7
Update SearchReplacer.php based off PHP CS
MarkBerube Nov 27, 2023
fde70ec
Update SearchReplacer.php with changes from PHPCS
MarkBerube Nov 27, 2023
2d7ce67
adding skip on phpcs incompat as testing shows its safe for PHP5.6 & …
MarkBerube Nov 28, 2023
9c46168
fixing small typo in behat scenario
MarkBerube Nov 28, 2023
afa1d7b
removing unncessary comment
MarkBerube Nov 28, 2023
7c373b4
removing unncessary comments
MarkBerube Nov 28, 2023
8f338d9
Update features/search-replace.feature scenario description
MarkBerube Nov 28, 2023
f6e1a3e
skip over replacements if TypeError is executed.
MarkBerube Nov 28, 2023
57cb6eb
converting obj to array to avoid errors with funky/blank objects on d…
MarkBerube Nov 29, 2023
6ff1d6b
adding safe object to search & replace over in test
MarkBerube Nov 29, 2023
d6437f2
removing array cast & testing serialized, safe object to confirm seri…
MarkBerube Nov 30, 2023
ac1ae3b
catch errors in unsafe php objects as they are iterated on
MarkBerube Dec 1, 2023
8889a18
Fix PHPCS issue
schlessera Dec 18, 2023
9404019
Include reason in error messages
schlessera Dec 18, 2023
251042b
Avoid casting objects to string
schlessera Dec 18, 2023
b3a1734
Split into two separate tests per PHP version
schlessera Dec 18, 2023
42ef6c2
Fully form forwarded exception
schlessera Dec 18, 2023
d6430f9
Be precise about PHPCS ignore
schlessera Dec 18, 2023
586522b
Add clarifying comment about type error
schlessera Dec 18, 2023
4509c7d
Add another clarifying comment
schlessera Dec 18, 2023
9c12684
Adapt warning for PHP < 8.0
schlessera Dec 18, 2023
e915dd8
Fix warning text in test
schlessera Dec 18, 2023
813403e
Fix bad anntotation
schlessera Dec 19, 2023
43abfb5
Add safeguard for partial processing to not be counted as a success
schlessera Dec 19, 2023
da1acc7
Skip broken SQLite testing for now
schlessera Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix PHPCS issue
schlessera committed Dec 18, 2023
commit 8889a18727e9264ddccba003a3bdc59d99248eae
2 changes: 1 addition & 1 deletion src/WP_CLI/SearchReplacer.php
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ private function run_recursively( $data, $serialised, $recursion_level = 0, $vis
foreach ( $data as $key => $value ) {
$data->$key = $this->run_recursively( $value, false, $recursion_level + 1, $visited_data );
}
} catch ( \Error $e ) {
} catch ( \Error $e ) { // phpcs:ignore PHPCompatibility.Classes.NewClasses.errorFound
\WP_CLI::warning(
sprintf(
'Skipping an inconvertible serialized object: "%s", replacements might not be complete.',