Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HttpUserAgent.php
Go to the documentation of this file.
1 <?php
26 #require_once 'Zend/Session/Validator/Abstract.php';
27 
38 {
39 
46  public function setup()
47  {
48  $this->setValidData( (isset($_SERVER['HTTP_USER_AGENT'])
49  ? $_SERVER['HTTP_USER_AGENT'] : null) );
50  }
51 
58  public function validate()
59  {
60  $currentBrowser = (isset($_SERVER['HTTP_USER_AGENT'])
61  ? $_SERVER['HTTP_USER_AGENT'] : null);
62 
63  return $currentBrowser === $this->getValidData();
64  }
65 
66 }