403Webshell
Server IP : 89.108.64.180  /  Your IP : 216.73.217.92
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-root ( 1010)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/wp-hotelier/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/wp-hotelier/includes/class-htl-api.php
<?php
/**
 * Hotelier API.
 *
 * Handles HTL-API endpoint requests (used by gateways)
 *
 * @author   Benito Lopez <hello@lopezb.com>
 * @category Class
 * @package  Hotelier/Classes
 * @version  1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

if ( ! class_exists( 'HTL_API' ) ) :

/**
 * HTL_API Class
 */
class HTL_API {

	/**
	 * Get things going
	 *
	 * @return HTL_API
	 */
	public function __construct() {
		// add query vars
		add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );

		// handle htl-api endpoint requests
		add_action( 'parse_request', array( $this, 'handle_api_requests' ), 0 );

		// Ensure payment gateways are initialized in time for API requests
		add_action( 'hotelier_api_request', array( 'HTL_Payment_Gateways', 'instance' ), 0 );
	}

	/**
	 * Add new query vars.
	 *
	 * @param $vars
	 * @return string[]
	 */
	public function add_query_vars( $vars ) {
		$vars[] = 'htl-api';
		return $vars;
	}

	/**
	 * API request
	 */
	public function handle_api_requests() {
		global $wp;

		if ( ! empty( $_GET[ 'htl-api' ] ) ) {
			$wp->query_vars[ 'htl-api' ] = $_GET[ 'htl-api' ];
		}

		// htl-api endpoint requests
		if ( ! empty( $wp->query_vars[ 'htl-api' ] ) ) {

			// Buffer, we won't want any output here
			ob_start();

			// No cache headers
			nocache_headers();

			// Clean the API request
			$api_request = strtolower( sanitize_text_field( $wp->query_vars[ 'htl-api' ] ) );

			// Trigger generic action before request hook
			do_action( 'hotelier_api_request', $api_request );

			// Is there actually something hooked into this API request? If not trigger 400 - Bad request
			status_header( has_action( 'hotelier_api_' . $api_request ) ? 200 : 400 );

			// Trigger an action which plugins can hook into to fulfill the request
			do_action( 'hotelier_api_' . $api_request );

			// Done, clear buffer and exit
			ob_end_clean();
			die('-1');
		}
	}
}

endif;

return new HTL_API();

Youez - 2016 - github.com/yon3zu
LinuXploit