Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
XssProtection.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  protected $headerName = 'X-XSS-Protection';
17 
19  const IE_8_USER_AGENT = 'MSIE 8';
20 
22  const HEADER_ENABLED = '1; mode=block';
23 
25  const HEADER_DISABLED = '0';
26 
30  private $headerService;
31 
35  public function __construct(Header $headerService)
36  {
37  $this->headerService = $headerService;
38  }
39 
45  public function getValue()
46  {
47  return strpos($this->headerService->getHttpUserAgent(), self::IE_8_USER_AGENT) === false
48  ? self::HEADER_ENABLED
49  : self::HEADER_DISABLED;
50  }
51 }