HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/www.winghung.com/wp-content/plugins/conversational-forms/classes/api/tokens.php
<?php

/**
 * REST API route for verification tokens
 *
 * @package Caldera_Forms Modified by QuantumCloud
 * @author    Josh Pollock <Josh@CalderaWP.com>
 * @license   GPL-2.0+
 * @link
 * @copyright 2016 CalderaWP LLC
 */
class Qcformbuilder_Forms_API_Tokens implements Qcformbuilder_Forms_API_Route {

	/**
	 * @since 1.5.0
	 * @deprecated 1.6.2
	 * @inheritdoc
	 */
	public function add_routes( $namespace ) {
		_deprecated_function( __FUNCTION__, '1.6.2', '');
		register_rest_route( $namespace, '/tokens/form',
			array(
				'methods'         => 'post',
				'callback'        => array( $this, 'get_new_nonce' ),
				'args'            => array(
					'form_id' => array(
						'required'          => 'true',
						'type'              => 'string',
						'validate_callback' => array( $this, 'form_exists' )
					)
				)
			)
		);
	}

	/**
	 * Check that form exists, by ID
	 *
	 * @since 1.5.0
	 * @deprecated 1.6.2
	 * @param string $form_id
	 *
	 * @return bool
	 */
	public function form_exists( $form_id ){
		_deprecated_function( __FUNCTION__, '1.6.2', '');
		$form = Qcformbuilder_Forms_Forms::get_form( $form_id );
		return ( is_array( $form ) && ! empty( $form ) );
	}

	/**
	 * Get a new form nonce
	 *
	 * @since 1.5.0
	 * @deprecated 1.6.2
	 *
	 * @param WP_REST_Request $request REST API request object
	 *
	 * @return Qcformbuilder_Forms_API_Response
	 */
	public function get_new_nonce( WP_REST_Request $request ){
		_deprecated_function( __FUNCTION__, '1.6.2', '');
		$form_id = $request[ 'form_id' ];
		$nonce = Qcformbuilder_Forms_Render_Nonce::create_verify_nonce( $form_id );
		$response = new Qcformbuilder_Forms_API_Response( array(
			'nonce' => $nonce,
		) );
		return $response;

	}
}