PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.7.3
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.7.3
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/API/Profile.php +11 -1 3.6.53.7.3 View file →
@@ -14,9 +14,12 @@
14 14 $this->get( 'profile/purchased-items', [ $this, 'get_my_purchased_items' ] );
15 15 }
16 16
17 17 public function sync() {
18 - $query = 'status, message, user{ id, name, first_name, last_name, display_name, email, profile_photo, joined, is_verified, api_key, plan, plan_expire_at, my_cloud{ limit, usages, last_pushed }, favourites{ id, type }, show_notice, reviews{ type, type_id, rating } }';
18 + // Keep the `subscription` field set in step with `Login::login()` — the
19 + // Subscription screen renders from whichever of the two answered last, so a
20 + // field missing here silently degrades the card after a profile sync.
21 + $query = 'status, message, user{ id, name, first_name, last_name, display_name, email, profile_photo, joined, is_verified, is_restricted_company_user, api_key, plan, plan_expire_at, my_cloud{ limit, usages, last_pushed }, favourites{ id, type }, show_notice, reviews{ type, type_id, rating }, subscription { id, name, sites, subscription_plan_id, ends_at, plan_type, cancel_at_period_end } }';
19 22
20 23 $funcArgs = [
21 24 'api_key' => $this->api_key,
22 25 'site_url' => home_url( '/' ),
@@ -65,8 +68,15 @@
65 68 $meta['reviews'] = $_reviews;
66 69 }
67 70
68 71 if ( ! empty( $response['user'] ) && is_array( $response['user'] ) ) {
72 + /**
73 + * The cloud API key must never be persisted here or sent to the client.
74 + * Under a global login this key belongs to the admin, while any user with
75 + * `delete_posts` can reach this endpoint. Login and SignUp already drop it.
76 + */
77 + unset( $response['user']['api_key'] );
78 +
69 79 $response['user']['site_url'] = base64_encode( home_url( '/' ) );
70 80 $response['user']['ip'] = Helper::get_ip();
71 81 }
72 82