Repository navigation
Conversation
…ther optional args Fixes WordPress#650. Unlike context, description and icon, the title key was accessed directly via $parsed['title'] without an array_key_exists() check, producing a PHP 8.x undefined-array-key warning when callers omit the key. Apply the same guard used for the other optional args, defaulting to an empty string. Add test_register_channel_without_title() to cover the missing-title path.
This branch has not been deployed
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 #650.
What problem does this fix?
Channel_Registry::register()accessed$parsed['title']directly without checking if the key exists, unlike every other optional key (context,description,icon) which all use anarray_key_exists()guard.On PHP 8.x this produces:
Changes
includes/class-channel-registry.php: apply the samearray_key_exists()guard totitle, defaulting to''when absent — consistent with how all other optional args are handled.tests/phpunit/tests/test-channel-registry.php: addtest_register_channel_without_title()covering registration without atitlekey.Testing
Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): claude-sonnet-4-6
Used for: Code implementation and test; reviewed and verified by contributor.