Skip to content

Commit ebab9ea

Browse files
chriszarateclaude
andcommitted
Fix term_exists() check and remove unused variable
- Use `! is_array()` instead of `=== false` for `term_exists()` since it never returns a bool (returns null|int|array|0). - Remove unused `$taxonomy` variable in taxonomy permission check. - Update MAX_UPDATE_DATA_SIZE docblock: enforced via maxLength (character count), not byte size. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bc456d7 commit ebab9ea

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/wp-includes/collaboration/class-wp-http-polling-sync-server.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class WP_HTTP_Polling_Sync_Server {
5454
const MAX_ROOMS_PER_REQUEST = 50;
5555

5656
/**
57-
* Maximum size (in bytes) of a single update data string.
57+
* Maximum length of a single update data string.
5858
*
5959
* @since 7.0.0
6060
* @var int
@@ -357,11 +357,10 @@ private function can_user_sync_entity_type( string $entity_kind, string $entity_
357357

358358
// Handle single taxonomy term entities with a defined object ID.
359359
if ( 'taxonomy' === $entity_kind ) {
360-
if ( term_exists( $object_id, $entity_name ) === false ) {
360+
if ( ! is_array( term_exists( $object_id, $entity_name ) ) ) {
361361
// Either term doesn't exist OR term is not in specified taxonomy.
362362
return false;
363363
}
364-
$taxonomy = get_taxonomy( $entity_name );
365364
return current_user_can( 'edit_term', $object_id );
366365
}
367366

0 commit comments

Comments
 (0)