Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
SecurityInfo Class Reference
Inheritance diagram for SecurityInfo:
SecurityInfoInterface

Public Member Functions

 __construct ($secureUrlList=[], $excludedUrlList=[])
 
 isSecure ($url)
 

Protected Attributes

 $secureUrlsList = []
 
 $excludedUrlsList = []
 
 $secureUrlsCache = []
 

Detailed Description

Definition at line 10 of file SecurityInfo.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $secureUrlList = [],
  $excludedUrlList = [] 
)
Parameters
string[]$secureUrlList
string[]$excludedUrlList

Definition at line 35 of file SecurityInfo.php.

36  {
37  $this->secureUrlsList = $secureUrlList;
38  $this->excludedUrlsList = $excludedUrlList;
39  }

Member Function Documentation

◆ isSecure()

isSecure (   $url)

Check whether url is secure

Parameters
string$url
Returns
bool

Implements SecurityInfoInterface.

Definition at line 47 of file SecurityInfo.php.

48  {
49  if (!isset($this->secureUrlsCache[$url])) {
50  $this->secureUrlsCache[$url] = false;
51  foreach ($this->excludedUrlsList as $match) {
52  if (strpos($url, (string)$match) === 0) {
53  return $this->secureUrlsCache[$url];
54  }
55  }
56  foreach ($this->secureUrlsList as $match) {
57  if (strpos($url, (string)$match) === 0) {
58  $this->secureUrlsCache[$url] = true;
59  break;
60  }
61  }
62  }
63  return $this->secureUrlsCache[$url];
64  }

Field Documentation

◆ $excludedUrlsList

$excludedUrlsList = []
protected

List of patterns excluded form secure url list

Definition at line 22 of file SecurityInfo.php.

◆ $secureUrlsCache

$secureUrlsCache = []
protected

Definition at line 29 of file SecurityInfo.php.

◆ $secureUrlsList

$secureUrlsList = []
protected

Definition at line 17 of file SecurityInfo.php.


The documentation for this class was generated from the following file: