- Timestamp:
- 03/05/2026 09:22:05 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/collaboration/class-wp-http-polling-sync-server.php
r61746 r61838 182 182 } 183 183 184 $rooms = $request['rooms']; 184 $rooms = $request['rooms']; 185 $wp_user_id = get_current_user_id(); 185 186 186 187 foreach ( $rooms as $room ) { 187 $room = $room['room']; 188 $client_id = $room['client_id']; 189 $room = $room['room']; 190 191 // Check that the client_id is not already owned by another user. 192 $existing_awareness = $this->storage->get_awareness_state( $room ); 193 foreach ( $existing_awareness as $entry ) { 194 if ( $client_id === $entry['client_id'] && $wp_user_id !== $entry['wp_user_id'] ) { 195 return new WP_Error( 196 'rest_cannot_edit', 197 __( 'Client ID is already in use by another user.' ), 198 array( 'status' => rest_authorization_required_code() ) 199 ); 200 } 201 } 202 188 203 $type_parts = explode( '/', $room, 2 ); 189 204 $object_parts = explode( ':', $type_parts[1] ?? '', 2 ); … … 347 362 'state' => $awareness_update, 348 363 'updated_at' => $current_time, 364 'wp_user_id' => get_current_user_id(), 349 365 ); 350 366 }
Note: See TracChangeset
for help on using the changeset viewer.