| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/test7.chuangfenglink.xyz/wp-content/plugins/fluentform/app/Modules/Form/ |
Upload File : |
<?php
namespace FluentForm\App\Modules\Form;
use FluentForm\App\Helpers\Helper;
use FluentForm\Framework\Foundation\Application;
use FluentForm\Framework\Helpers\ArrayHelper;
class HoneyPot
{
private $app;
public function __construct(Application $application)
{
$this->app = $application;
}
public function renderHoneyPot($form)
{
if (!$this->isEnabled($form->id)) {
return;
}
$fieldName = $this->getFieldName($form->id);
$fieldId = 'ff_' . $form->id . '_item_sf' ;
$labels = ['Newsletter', 'Updates', 'Contact', 'Subscribe', 'Notify'];
$randomLabel = $labels[array_rand($labels)];
?>
<div
style="display: none!important; position: absolute!important; transform: translateX(1000%)!important;"
class="ff-el-group ff-hpsf-container"
>
<div class="ff-el-input--label asterisk-right">
<label for="<?php echo esc_attr($fieldId); ?>" aria-label="<?php echo esc_attr($randomLabel); ?>">
<?php echo esc_html($randomLabel); ?>
</label>
</div>
<div class="ff-el-input--content">
<input type="text"
name="<?php echo esc_attr($fieldName); ?>"
class="ff-el-form-control"
id="<?php echo esc_attr($fieldId); ?>"
/>
</div>
</div>
<?php
}
public function verify($insertData, $requestData, $formId)
{
if (!$this->isEnabled($formId) || (
Helper::isConversionForm($formId) &&
ArrayHelper::isTrue($requestData, 'isFFConversational')
)) {
return;
}
$honeyPotName = $this->getFieldName($formId);
if (
!ArrayHelper::exists($requestData, $honeyPotName) ||
!empty(ArrayHelper::get($requestData, $honeyPotName))
) {
wp_send_json(
[
'errors' => __('Sorry! You can not submit this form at this moment!', 'fluentform'),
],
422
);
}
return;
}
public function isEnabled($formId = false)
{
$option = get_option('_fluentform_global_form_settings');
$status = 'yes' == ArrayHelper::get($option, 'misc.honeypotStatus');
return apply_filters('fluentform/honeypot_status', $status, $formId);
}
private function getFieldName($formId)
{
$honeyPotName = 'item_' . $formId . '__fluent_sf';
return apply_filters('fluentform/honeypot_name', $honeyPotName, $formId);
}
}