-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Check cache return value in metadata_exists(), get_metadata_raw(), an… #13481
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
Closed
josephscott
wants to merge
17
commits into
WordPress:trunk
from
josephscott:66091/meta-cache-return-checks
+142
−7
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bc1e528
Check cache return value in metadata_exists(), get_metadata_raw(), an…
josephscott a6d724f
Merge branch 'trunk' into 66091/meta-cache-return-checks
josephscott 718ed75
Merge branch 'trunk' into 66091/meta-cache-return-checks
sirreal 215ae90
Move the $invalid_ids check to happen earlier
josephscott e18afdb
Merge branch 'trunk' into 66091/meta-cache-return-checks
sirreal 57b87e2
Update tests/phpunit/tests/meta.php
josephscott ec5f3ce
Merge branch 'trunk' into 66091/meta-cache-return-checks
josephscott 4a16be7
Merge branch 'trunk' into 66091/meta-cache-return-checks
sirreal e86acd5
Rename $invalid_ids to $invalid_cache_ids
josephscott a3cf1c6
Add a unique message to each test assertion
josephscott 11eeaab
Rename $cached_value to $invalid_cached_value in tests
josephscott 4308d68
Merge branch 'trunk' into 66091/meta-cache-return-checks
josephscott 0ebd216
Merge branch 'trunk' into 66091/meta-cache-return-checks
westonruter 2920255
Add assertions which guard against PHPStan errors
westonruter 54de664
Merge branch 'trunk' into 66091/meta-cache-return-checks
sirreal e2d0ca1
Merge branch 'trunk' into 66091/meta-cache-return-checks
peterwilsoncc 0b9dffe
Merge branch 'trunk' into 66091/meta-cache-return-checks
peterwilsoncc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
It's not directly related but a valid cache of an empty array will follow the
update_meta_cache()flow.update_meta_cache()will detect that the cache is primed so it's not a big deal.Do you think it's worth including that as part of the fix for this ticket?
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.
I don't think that is worth including for this PR - where the focus was on avoiding fatal error conditions. I'd rather see that happen in a separate PR.
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.
I'd probably include
test_get_metadata_hits_cache_when_no_meta_data_set()in a separate PR as well, associated with empty cache array idea.