BcUtil::getFullDomain PHP Method

getFullDomain() public static method

public static getFullDomain ( )
    public static function getFullDomain()
    {
        if (isConsole() && empty($_SERVER['HTTP_HOST'])) {
            return '';
        }
        return $_SERVER['HTTP_HOST'];
    }

Usage Example

 /**
  * リファラチェックを行う
  *
  * @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();
     }
 }
All Usage Examples Of BcUtil::getFullDomain