Plugin Directory

Changeset 3473161


Ignore:
Timestamp:
03/03/2026 12:26:33 AM (5 weeks ago)
Author:
cfinke
Message:

Remove the use of a URL token to auto-connect an Akismet API key.

This workflow has been obsolete and not supported on the server-side for some time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/class.akismet-admin.php

    r3473046 r3473161  
    11701170        }
    11711171
    1172         // the user can choose to auto connect their API key by clicking a button on the akismet done page
    1173         // if jetpack, get verified api key by using connected wpcom user id
    1174         // if no jetpack, get verified api key by using an akismet token
     1172        // The user can choose to auto-connect their API key by clicking a button on the Akismet done page.
     1173        // If Jetpack is insalled and connected, use the connected wpcom user.
    11751174
    11761175        $akismet_user = false;
    11771176
    1178         if ( isset( $_GET['token'] ) && preg_match( '/^(\d+)-[0-9a-f]{20}$/', $_GET['token'] ) ) {
    1179             $akismet_user = self::verify_wpcom_key( '', '', array( 'token' => $_GET['token'] ) );
    1180         }
    1181 
    1182         if ( false === $akismet_user ) {
    1183             $jetpack_user = self::get_jetpack_user();
    1184 
    1185             if ( is_array( $jetpack_user ) ) {
    1186                 $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );
    1187             }
    1188         }
    1189 
    1190         if ( isset( $_GET['action'] ) ) {
    1191             if ( $_GET['action'] == 'save-key' ) {
    1192                 if ( is_object( $akismet_user ) ) {
    1193                     self::save_key( $akismet_user->api_key );
    1194                     self::display_configuration_page();
    1195                     return;
    1196                 }
    1197             }
     1177        $jetpack_user = self::get_jetpack_user();
     1178
     1179        if ( is_array( $jetpack_user ) ) {
     1180            $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );
    11981181        }
    11991182
Note: See TracChangeset for help on using the changeset viewer.