is the host any of the registered URLs for this website?
public static isHostKnownAliasHost ( $urlHost, $idSite ) |
/** * Detect whether action is an outlink given host aliases * * @param Action $action * @return bool true if the outlink the visitor clicked on points to one of the known hosts for this website */ protected function detectActionIsOutlinkOnAliasHost(Action $action, $idSite) { $decodedActionUrl = $action->getActionUrl(); $actionUrlParsed = @parse_url($decodedActionUrl); if (!isset($actionUrlParsed['host'])) { return false; } return Visit::isHostKnownAliasHost($actionUrlParsed['host'], $idSite); }
/** * Detect whether action is an outlink given host aliases * * @param Action $action * @return bool true if the outlink the visitor clicked on points to one of the known hosts for this website */ public static function detectActionIsOutlinkOnAliasHost(Action $action, $idSite) { if ($action->getActionType() != Action::TYPE_OUTLINK) { return false; } $decodedActionUrl = $action->getActionUrl(); $actionUrlParsed = @parse_url($decodedActionUrl); if (!isset($actionUrlParsed['host'])) { return false; } return Visit::isHostKnownAliasHost($actionUrlParsed['host'], $idSite); }
/** * We have previously tried to detect the campaign variables in the URL * so at this stage, if the referrer host is the current host, * or if the referrer host is any of the registered URL for this website, * it is considered a direct entry * @return bool */ protected function detectReferrerDirectEntry() { if (!empty($this->referrerHost)) { // is the referrer host the current host? if (isset($this->currentUrlParse['host'])) { $currentHost = Common::mb_strtolower($this->currentUrlParse['host'], 'UTF-8'); if ($currentHost == Common::mb_strtolower($this->referrerHost, 'UTF-8')) { $this->typeReferrerAnalyzed = Common::REFERRER_TYPE_DIRECT_ENTRY; return true; } } if (Visit::isHostKnownAliasHost($this->referrerHost, $this->idsite)) { $this->typeReferrerAnalyzed = Common::REFERRER_TYPE_DIRECT_ENTRY; return true; } } return false; }