HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/thwoodlg/public_html/wp-content/plugins/duplicator-pro/classes/entities/class.verifiers.php
<?php
/**
 * @copyright 2016 Snap Creek LLC
 */
defined('ABSPATH') || defined('DUPXABSPATH') || exit;

class DUP_PRO_Verifier_Base
{
    protected $error_text = '';

    function __construct($error_text = '')
    {
        $this->error_text = $error_text;
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        return "";
    }
}

/**
 * @copyright 2016 Snap Creek LLC
 */
class DUP_PRO_Range_Verifier extends DUP_PRO_Verifier_Base
{
    protected $min = 0;
    protected $max = 0;

    function __construct($min = 0, $max = 0, $error_text = '')
    {
        parent::__construct($error_text);

        $this->min = $min;
        $this->max = $max;
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        if (($value < $this->min) || ($value > $this->max)) {

            return $this->error_text;
        } else {

            return "";
        }
    }
}

/**
 * @copyright 2016 Snap Creek LLC
 */
class DUP_PRO_Length_Verifier extends DUP_PRO_Verifier_Base
{
    protected $max_length = 0;

    function __construct($max_length = 0, $error_text = '')
    {
        parent::__construct($error_text);
        $this->max_length = $max_length;
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        if (strlen($value) > $this->max_length) {
            return $this->error_text;
        } else {

            return '';
        }
    }
}

/**
 * @copyright 2016 Snap Creek LLC
 */
class DUP_PRO_Email_Verifier extends DUP_PRO_Verifier_Base
{
    protected $allow_blank = false;

    function __construct($allow_blank = false, $error_text = '')
    {
        parent::__construct($error_text);
        $this->allow_blank = $allow_blank;
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        if ($this->allow_blank) {
            if (trim($value) == '') {
                return '';
            }
        }

        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
            return $this->error_text;
        } else {
            return '';
        }
    }
}

/**
 * @copyright 2016 Snap Creek LLC
 */
class DUP_PRO_Required_Verifier extends DUP_PRO_Verifier_Base
{

    function __construct($error_text = '')
    {
        parent::__construct($error_text);
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        if (trim($value) == '') {
            return $this->error_text;
        } else {
            return '';
        }
    }
}

/**
 * @copyright 2016 Snap Creek LLC
 */
class DUP_PRO_Regex_Verifier extends DUP_PRO_Verifier_Base
{
    private $regex       = '';
    private $allow_blank = false;

    function __construct($regex = '', $error_text = '', $allow_blank = false)
    {
        parent::__construct($error_text);
        $this->regex       = $regex;
        $this->allow_blank = $allow_blank;
    }

    // Returns an error string if succeeded or empty string if failed.
    public function Verify($value)
    {
        if ((trim($value) == '') && ($this->allow_blank)) {
            return '';
        }

        if (preg_match($this->regex, $value) != 1) {
            return $this->error_text;
        } else {
            return "";
        }
    }
}