• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / edd_validate_user_verification_token() – Generate a token for a URL and match it against the existing token to make sure the URL hasn’t been tampered with.

You appear to be a bot. Output may be restricted

Description

Generate a token for a URL and match it against the existing token to make sure the URL hasn't been tampered with.

Usage

$bool = edd_validate_user_verification_token( $url );

Parameters

$url
( string ) optional – URL to test.

Returns

bool

Source

File name: easy-digital-downloads/includes/user-functions.php
Lines:

1 to 33 of 33
function edd_validate_user_verification_token( $url = '' ) {

  $ret        = false;
  $parts      = parse_url( $url );
  $query_args = array();

  if ( isset( $parts['query'] ) ) {

    wp_parse_str( $parts['query'], $query_args );

    if ( isset( $query_args['ttl'] ) && current_time( 'timestamp' ) > $query_args['ttl'] ) {

      do_action( 'edd_user_verification_token_expired' );

      $link_text = sprintf(
        __( 'Sorry but your account verification link has expired. <a href="%s">Click here</a> to request a new verification URL.', 'easy-digital-downloads' ),
        edd_get_user_verification_request_url()
      );

      wp_die( apply_filters( 'edd_verification_link_expired_text', $link_text ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );

    }

    if ( isset( $query_args['token'] ) && $query_args['token'] == edd_get_user_verification_token( $url ) ) {

      $ret = true;

    }

  }

  return apply_filters( 'edd_validate_user_verification_token', $ret, $url, $query_args );
}
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: edd_validate_user_verification_token
Plugin ref: Easy Digital Downloads
Version: 2.9.23
Sourcefile: includes/user-functions.php
File ref: includes/user-functions.php
Deprecated?: No
API Letters: E,T,U,V

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites