Skip to content

Commit

Permalink
cloud api token check
Browse files Browse the repository at this point in the history
  • Loading branch information
lightbulbman committed Sep 12, 2023
1 parent cbf06a5 commit f59a7f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion php/cloud/class-cloud-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function get_local_to_cloud_map() {

// Fetch data from the stored transient, if available.
$stored_data = get_transient( self::CLOUD_MAP_TRANSIENT_KEY );
if ( $stored_data && is_array( $stored_data ) ) {
if ( $stored_data ) {
$this->local_to_cloud_map = $stored_data;
return $stored_data;
}
Expand All @@ -81,6 +81,12 @@ public function get_local_to_cloud_map() {
continue;
}

// If the snippet is a token snippet skip it.
$has_valid_cloud_id = boolval( strpos( $local_snippet->cloud_id, '_' ) );
if ( ! $has_valid_cloud_id ) {
continue;
}

$link = new Cloud_Link();
$cloud_id = explode( '_', $local_snippet->cloud_id );
$cloud_id_int = (int) $cloud_id[0] ?? '';
Expand Down

0 comments on commit f59a7f7

Please sign in to comment.