/** * getCurrentDomain * * @param null $default * * @return null|string */ public function getCurrentDomain($default = null) { $currentDomain = PhpServer::getRequestDomain(); //Use the default site if the requested domain name is an IP address $ipValidator = new Ip(); if ($ipValidator->isValid($currentDomain)) { $currentDomain = $default; } return $currentDomain; }