Fix passing null to strpos in gatherpress transformer (#69)
All checks were successful
PHP Code Checker / PHP Code Checker (push) Successful in 40s
PHPUnit / PHPUnit – PHP 8.1 (push) Successful in 1m11s
PHPUnit / PHPUnit – PHP 8.2 (push) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.3 (push) Successful in 1m1s

Reviewed-on: Event-Federation/wordpress-activitypub-event-bridge#69
Co-authored-by: André Menrath <andre.menrath@posteo.de>
Co-committed-by: André Menrath <andre.menrath@posteo.de>
This commit is contained in:
André Menrath 2024-10-19 16:58:54 +02:00 committed by André Menrath
parent 7bc134e135
commit 2e9d4c4523
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@
], ],
"test-debug": [ "test-debug": [
"@prepare-test", "@prepare-test",
"@test-modern-events-calendar-lite" "@test-gatherpress"
], ],
"test-vs-event-list": "phpunit --filter=vs_event_list", "test-vs-event-list": "phpunit --filter=vs_event_list",
"test-the-events-calendar": "phpunit --filter=the_events_calendar", "test-the-events-calendar": "phpunit --filter=the_events_calendar",

View file

@ -124,7 +124,7 @@ final class GatherPress extends Event {
*/ */
public static function filter_gatherpress_blocks( $block_content, $block ) { public static function filter_gatherpress_blocks( $block_content, $block ) {
// Check if the block name starts with 'gatherpress'. // Check if the block name starts with 'gatherpress'.
if ( strpos( $block['blockName'], 'gatherpress/' ) === 0 ) { if ( isset( $block['blockName'] ) && 0 === strpos( $block['blockName'], 'gatherpress/' ) ) {
return ''; // Skip rendering this block. return ''; // Skip rendering this block.
} }