Code Duplication    Length = 6-6 lines in 2 locations

includes/wpinv-invoice-functions.php 1 location

@@ 1480-1485 (lines=6) @@
1477
            $user_id = $invoice->get_user_id();
1478
            $secret = sanitize_text_field( $_GET['_wpipay'] );
1479
            
1480
            if ( $secret === md5( $user_id . '::' . $invoice->get_email() . '::' . $invoice_key ) ) { // valid invoice link
1481
                $redirect_to = remove_query_arg( '_wpipay', get_permalink() );
1482
                
1483
                wpinv_guest_redirect( $redirect_to, $user_id );
1484
                wpinv_die();
1485
            }
1486
        }
1487
    }
1488
}

includes/wpinv-template-functions.php 1 location

@@ 802-807 (lines=6) @@
799
                $user_id = $invoice->get_user_id();
800
                $secret = sanitize_text_field( $_GET['_wpipay'] );
801
802
                if ( $secret === md5( $user_id . '::' . $invoice->get_email() . '::' . $invoice->get_key() ) ) { // valid invoice link
803
                    $redirect_to = remove_query_arg( '_wpipay', get_permalink() );
804
805
                    wpinv_guest_redirect( $redirect_to, $user_id );
806
                    wpinv_die();
807
                }
808
            }
809
            $redirect_to = is_user_logged_in() ? wpinv_get_history_page_uri() : wp_login_url( get_permalink() );
810