Plugin Directory

Changeset 2890978


Ignore:
Timestamp:
03/31/2023 07:45:20 AM (3 years ago)
Author:
supportcandy
Message:

SQL Injection fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • supportcandy/trunk/includes/class-wpsc-current-user.php

    r2873748 r2890978  
    165165
    166166            // guest login.
    167             $gs         = get_option( 'wpsc-gs-general' );
     167            $gs = get_option( 'wpsc-gs-general' );
     168
    168169            $login_auth = isset( $_COOKIE['wpsc_guest_login_auth'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['wpsc_guest_login_auth'] ) ) : '';
    169170            $login_auth = $login_auth ? json_decode( $login_auth ) : false;
     171
     172            if ( ! $login_auth ) {
     173                self::$current_user = new WPSC_Current_User();
     174                return;
     175            }
     176
     177            $login_auth->email = $login_auth->email ? sanitize_email( $login_auth->email ) : '';
     178            if ( ! $login_auth->email ) {
     179                self::$current_user = new WPSC_Current_User();
     180                return;
     181            }
    170182
    171183            if ( $login_auth && self::validate_guest_login( $login_auth ) ) {
Note: See TracChangeset for help on using the changeset viewer.