-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix some instances of null array key access #10136
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
mukeshpanchal27
wants to merge
17
commits into
WordPress:trunk
from
mukeshpanchal27:fix/null-array-key
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
08d48cb
Update is_registered method to handle null template name
mukeshpanchal27 92aecfb
Update class-wp-block-bindings-registry.php
mukeshpanchal27 f0a6251
Update class-wp-block-pattern-categories-registry.php
mukeshpanchal27 9afab59
Change pattern_name parameter to nullable string
mukeshpanchal27 4549185
Update parameter types in is_registered method
mukeshpanchal27 fbdd678
Fix parameter type hint in is_registered method
mukeshpanchal27 7a6617c
Apply suggestions from code review
mukeshpanchal27 73b7df3
Add test for empty source name registration
mukeshpanchal27 0ea22bf
Add unit tests for WP_Block_Pattern_Categories_Registry::is_registered()
mukeshpanchal27 5ad8626
Add tests for WP_Block_Patterns_Registry methods
mukeshpanchal27 9fed959
Add unit tests for WP_Block_Styles_Registry::is_registered
mukeshpanchal27 11d25ce
Update WpBlockTemplatesRegistry.php
mukeshpanchal27 5581a47
Remove bool check
mukeshpanchal27 4a066b8
Run unit tests against PHP 8.5
mukeshpanchal27 1d47043
Check for null param
mukeshpanchal27 7165f9b
Move tests
mukeshpanchal27 7bc2cd2
Remove empty check
mukeshpanchal27 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
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
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
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
22 changes: 22 additions & 0 deletions
22
tests/phpunit/tests/block-pattern/wpBlockPatternCategoriesRegistry.php
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?php | ||
| /** | ||
| * Unit tests for WP_Block_Pattern_Categories_Registry::is_registered(). | ||
| * | ||
| * @package WordPress | ||
| * @subpackage Blocks | ||
| * @since 6.9.0 | ||
| * | ||
| * @group block-patterns | ||
| * @covers WP_Block_Pattern_Categories_Registry::is_registered | ||
| */ | ||
|
|
||
| class Tests_Block_Pattern_WPBlockPatternCategoriesRegistry extends WP_UnitTestCase { | ||
|
|
||
| /** | ||
| * @ticket 63957 | ||
| */ | ||
| public function test_is_registered_with_null_category_name() { | ||
| $registry = WP_Block_Pattern_Categories_Registry::get_instance(); | ||
| $this->assertFalse( $registry->is_registered( null ) ); | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.