public static function domains() { // Only return configured domains if domain_mode is active. This is typically disabled // if there are no domains configured, or if testing locally if (self::is_domain_mode()) { return self::config()->domains; } else { return array(); } }
/** * Determine if the referrer for this request is from a domain within this website's scope * * @return boolean */ protected function knownReferrer() { // Extract referrer if (empty($_SERVER['HTTP_REFERER'])) { return false; } $hostname = strtolower(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)); // Check if internal traffic if ($hostname == strtolower($_SERVER['HTTP_HOST'])) { return true; } // Check configured domains $domains = Fluent::domains(); return isset($domains[$hostname]); }