secureUrlsList = $secureUrlList; $this->excludedUrlsList = $excludedUrlList; } /** * Check whether url is secure * * @param string $url * @return bool */ public function isSecure($url) { if (!isset($this->secureUrlsCache[$url])) { $this->secureUrlsCache[$url] = false; foreach ($this->excludedUrlsList as $match) { if (strpos($url, (string)$match) === 0) { return $this->secureUrlsCache[$url]; } } foreach ($this->secureUrlsList as $match) { if (strpos($url, (string)$match) === 0) { $this->secureUrlsCache[$url] = true; break; } } } return $this->secureUrlsCache[$url]; } }