sudo-su icon indicating copy to clipboard operation
sudo-su copied to clipboard

Recommend ` allowed_tlds ` parameters using `APP_ENV` global variables

Open AuroraLZDF opened this issue 7 years ago • 0 comments

I had the same problem #21 ,and try to modify allowed_tlds array, but no resolve. So I found the following code:

protected function getRequestTld()
    {
        $requestHost = parse_url(Request::url())['host'];
        $exploded = explode('.', $requestHost);
        $requestTld = end($exploded);

        return $requestTld;
    }

protected function tldIsAllowed()
    {
        $requestTld = $this->getRequestTld();
        $allowedTlds = Config::get('sudosu.allowed_tlds');

        return in_array($requestTld, $allowedTlds);
    }

that line code return in_array($requestTld, $allowedTlds); show to use the domain name suffix. /(ㄒoㄒ)/~~ So I would suggest using the APP_ENV variable.

(The end, Please excuse my poor English expression)

AuroraLZDF avatar Nov 09 '17 02:11 AuroraLZDF