| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/mastersystem.app/public/wp-content/plugins/mailpoet/lib/Captcha/ |
Upload File : |
<?php declare(strict_types = 1);
namespace MailPoet\Captcha;
if (!defined('ABSPATH')) exit;
use MailPoetVendor\Gregwar\Captcha\PhraseBuilder;
class CaptchaPhrase {
private CaptchaSession $session;
private PhraseBuilder $phraseBuilder;
public function __construct(
CaptchaSession $session,
?PhraseBuilder $phraseBuilder = null
) {
$this->session = $session;
$this->phraseBuilder = $phraseBuilder ?? new PhraseBuilder();
}
public function createPhrase(string $sessionId): string {
$storage = ['phrase' => $this->phraseBuilder->build()];
$this->session->setCaptchaHash($sessionId, $storage);
return $storage['phrase'];
}
public function getPhrase(string $sessionId): ?string {
$storage = $this->session->getCaptchaHash($sessionId);
return (isset($storage['phrase']) && is_string($storage['phrase'])) ? $storage['phrase'] : null;
}
}