• 15
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Zend InputFilter requires intl PHP extension?

I am setting up some filters and validators for my form, but when I submit it, this error appears: "Zend\I18n\Filter component requires the intl PHP extension". Is this because of the Alnum and Alpha validators ?

Code:

     public function getInputFilter() {
        if (!$this->inputFilter) {
            $inputFilter = new InputFilter();

            $inputFilter->add(array(
                'name' => 'email',
                'required' => true,
                "filters" => array(
                    array('name' => 'StringTrim'),
                    array('name' => 'StripTags')),
                'validators' => array(
                    array(
                        'name' => 'Regex',
                        'options' => array(
                            'pattern' => '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/',
                            'messages' => array(
                                Regex::NOT_MATCH => '?-???? ?????? ? ?????????.',
                            ),
                        ),
                        'break_chain_on_failure' => true
                    ),
                    array(
                        'name' => 'EmailAddress',
                        'options' => array(
                            'messages' => array(
                                EmailAddress::INVALID_FORMAT => "?-???? ?????? ? ?????????.",
                                EmailAddress::INVALID => "",
                                EmailAddress::INVALID_LOCAL_PART => "",
                                EmailAddress::INVALID_HOSTNAME => "",
                                EmailAddress::INVALID_SEGMENT => "",
                                EmailAddress::DOT_ATOM => "",
                                EmailAddress::INVALID_MX_RECORD => "",
                            ),
                        ),
                    ),
                ),
            ));

            $inputFilter->add((array(
                'name' => 'name',
                'required' => true,
                "filters" => array(
                    array('name' => 'StringTrim'),
                    array('name' => 'StripTags')),
                'validators' => array(
                    array(
                        'name' => 'Alpha',
                    ),
                ),
            )));

            $inputFilter->add((array(
                'name' => 'password',
                'required' => true,
                "filters" => array(
                    array('name' => 'StringTrim'),
                    array('name' => 'StripTags')),
                'validators' => array(
                    array(
                        'name' => 'Alnum',
                    ),
                    array(
                        'name' => 'StringLength',
                        'options' => array(
                            'min' => 6,
                            'max' => 12,
                            'messages' => array(
                                StringLength::INVALID => "???????? ?????? ?? ? ?? 6 ?? 12 ???????",
                            ),
                        ),
                    ),
                ),
            )));
          }

On Ubuntu 18.04, with PHP 7.2, try:

sudo apt-get install php7.2-intl
sudo service apache2 restart

If don't works enable extension=php_intl.dll in:

vim /etc/php/7.2/apache2/php.ini
sudo service apache2 restart
  • 1
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions