Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AccessList.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
10 
13 
17 class AccessList extends Varnish
18 {
22  public function beforeSave()
23  {
24  parent::beforeSave();
25 
26  $value = $this->getValue();
27  if (!is_string($value) || !preg_match('/^[\w\s\.\-\,\:]+$/', $value)) {
28  throw new LocalizedException(
29  new Phrase(
30  'Access List value "%1" is not valid. '
31  .'Please use only IP addresses and host names.',
32  [$value]
33  )
34  );
35  }
36  }
37 }
$value
Definition: gender.phtml:16