PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.6.8
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.6.8
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/Utils/Http.php +1 -13 3.7.53.6.8 View file →
@@ -79,22 +79,10 @@
79 79 if ( empty( $return_url ) ) {
80 80 $return_url = admin_url( 'admin.php?page=templately' );
81 81 }
82 82
83 - // Unique random state — doubles as cache busting and as the CSRF token the
84 - // callback validates. Only minted into a transient for a logged-in user:
85 - // this endpoint is public, and an anonymous caller could otherwise flood
86 - // wp_options with tokens that can never authorize anything.
87 - $state = wp_generate_password( 32, false );
88 - $state_owner = get_current_user_id();
89 -
90 - if ( $state_owner > 0 ) {
91 - Database::set_transient( 'google_state_' . $state, $state_owner, 15 * MINUTE_IN_SECONDS );
92 - }
93 -
94 83 $return_params = [
95 84 'templately_google_login' => '1',
96 - 'templately_state' => $state,
97 85 ];
98 86
99 87 // Add redirect-to parameter if provided
100 88 if (!empty($redirect_to)) {
@@ -105,9 +93,9 @@
105 93
106 94 $query_params = [
107 95 'site_url' => urlencode($site_url_with_params),
108 96 'site_ip' => Helper::get_ip(),
109 - 'state' => $state,
97 + 'state' => wp_generate_password(32, false) // Add unique random state for cache busting
110 98 ];
111 99
112 100 return add_query_arg($query_params, $auth_url);
113 101 }