Code Duplication    Length = 8-8 lines in 2 locations

projects/packages/sync/src/class-rest-endpoints.php 1 location

@@ 770-777 (lines=8) @@
767
	 *
768
	 * @return string|string[]|null
769
	 */
770
	protected static function sanitize_item_ids( $item ) {
771
		// lets not delete any options that don't start with jpsq_sync-
772
		if ( ! is_string( $item ) || substr( $item, 0, 5 ) !== 'jpsq_' ) {
773
			return null;
774
		}
775
		//Limit to A-Z,a-z,0-9,_,-,.
776
		return preg_replace( '/[^A-Za-z0-9-_.]/', '', $item );
777
	}
778
779
}
780

projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php 1 location

@@ 421-428 (lines=8) @@
418
		);
419
	}
420
421
	protected static function sanitize_item_ids( $item ) {
422
		// lets not delete any options that don't start with jpsq_sync-
423
		if ( ! is_string( $item ) || substr( $item, 0, 5 ) !== 'jpsq_' ) {
424
			return null;
425
		}
426
		//Limit to A-Z,a-z,0-9,_,-,.
427
		return preg_replace( '/[^A-Za-z0-9-_.]/', '', $item );
428
	}
429
}
430
431
class Jetpack_JSON_API_Sync_Unlock_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {