Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CookieDomainValidator.php
Go to the documentation of this file.
1 <?php
8 
9 class CookieDomainValidator extends \Magento\Framework\Validator\AbstractValidator
10 {
14  public function isValid($value)
15  {
16  $this->_clearMessages();
17  if (!is_string($value)) {
18  $this->_addMessages(['must be a string']);
19  return false;
20  }
21 
22  $validator = new \Zend\Validator\Hostname(\Zend\Validator\Hostname::ALLOW_ALL);
23 
24  if (!empty($value) && !$validator->isValid($value)) {
25  $this->_addMessages($validator->getMessages());
26  return false;
27  }
28  return true;
29  }
30 }
$value
Definition: gender.phtml:16