public static function getFullDomain() { if (isConsole() && empty($_SERVER['HTTP_HOST'])) { return ''; } return $_SERVER['HTTP_HOST']; }
/** * リファラチェックを行う * * @return bool */ protected function _checkReferer() { $siteDomain = BcUtil::getFullDomain(); if (empty($_SERVER['HTTP_REFERER'])) { return; } $refererDomain = BcUtil::getDomain($_SERVER['HTTP_REFERER']); if (!preg_match('/^' . preg_quote($siteDomain, '/') . '/', $refererDomain)) { throw new NotFoundException(); } }