_validateInput example

/** * Validate input - check form field rules defined by merchant * Checks captcha and doing simple blacklist-/spam-check * * Populates $this->_errors * Modifies $this->_elements * * @throws Exception */
    private function checkFields(): void
    {
        $this->_errors = $this->_validateInput($this->Request()->getPost()$this->_elements);

        if (!empty(Shopware()->Config()->get('CaptchaColor'))) {
            $captchaValidator = $this->container->get('shopware.captcha.validator');

            if (!$captchaValidator->validate($this->Request())) {
                $this->_elements['sCaptcha']['class'] = ' instyle_error has--error';
                $this->_errors['e']['sCaptcha'] = true;
            }
        }

        if (!empty($this->_errors)) {
            
Home | Imprint | This part of the site doesn't use cookies.