Code Duplication    Length = 6-6 lines in 2 locations

includes/wpinv-invoice-functions.php 1 location

@@ 1969-1974 (lines=6) @@
1966
            $user_id = $invoice->get_user_id();
1967
            $secret = sanitize_text_field( $_GET['_wpipay'] );
1968
            
1969
            if ( $secret === md5( $user_id . '::' . $invoice->get_email() . '::' . $invoice_key ) ) { // valid invoice link
1970
                $redirect_to = remove_query_arg( '_wpipay', get_permalink() );
1971
                
1972
                wpinv_guest_redirect( $redirect_to, $user_id );
1973
                wpinv_die();
1974
            }
1975
        }
1976
    }
1977
}

includes/wpinv-template-functions.php 1 location

@@ 794-799 (lines=6) @@
791
                $user_id = $invoice->get_user_id();
792
                $secret = sanitize_text_field( $_GET['_wpipay'] );
793
794
                if ( $secret === md5( $user_id . '::' . $invoice->get_email() . '::' . $invoice->get_key() ) ) { // valid invoice link
795
                    $redirect_to = remove_query_arg( '_wpipay', get_permalink() );
796
797
                    wpinv_guest_redirect( $redirect_to, $user_id );
798
                    wpinv_die();
799
                }
800
            }
801
            $redirect_to = is_user_logged_in() ? wpinv_get_history_page_uri() : wp_login_url( get_permalink() );
802