Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.64.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : FrmValidate.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	die( 'You are not allowed to call this page directly.' );
}

abstract class FrmValidate {

	/**
	 * @var int
	 */
	protected $form_id;

	/**
	 * @var object
	 */
	protected $form;

	/**
	 * @since 6.21
	 * @var string
	 */
	protected $option_type = 'form';

	/**
	 * @param int $form_id
	 */
	public function __construct( $form_id ) {
		$this->form_id = $form_id;
	}

	/**
	 * @return object $form
	 */
	protected function get_form() {
		if ( empty( $this->form ) ) {
			$this->form = FrmForm::getOne( $this->form_id );
		}
		return $this->form;
	}

	/**
	 * @return bool
	 */
	protected function is_option_on() {
		$key = $this->get_option_key();
		if ( 'global' === $this->option_type ) {
			$frm_settings = FrmAppHelper::get_settings();
			return ! empty( $frm_settings->$key );
		}

		$form = $this->get_form();
		return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
	}

	/**
	 * @return bool|string
	 */
	abstract public function validate();

	/**
	 * Track the form option key used for is_option_on function.
	 *
	 * @return string
	 */
	abstract protected function get_option_key();
}
© 2025 XylotrechusZ