protected function isRedirectionUrlValid(string $url)
    {
        // No http or https
        if (stripos(trim($url), "http")===0){
            return false;
        }

        // In fact no scheme:// at all thanks.
        if (stripos($url, "://")!==false){
            return false;
        }

        return true;
    }
protected function isRedirectionUrlValid(string $url)
    {
        // No http or https
        if (stripos(trim($url), "http")===0){
            return false;
        }

        // In fact no scheme:// at all thanks.
        if (stripos($url, "://")!==false){
            return false;
        }

        return true;
    }
protected function isRedirectionUrlValid ( string $ url ) { // No http or https if ( stripos ( trim ( $ url ) , "http" ) === 0 ) { return false ; } // In fact no scheme:// at all thanks. if ( stripos ( $ url , "://" ) !== false ) { return false ; } return true ; }
Checks to make sure the URL is a relative or absolute path on the
existing domain.

Simply returns false if the url starts with http or https

@param string $url
@return bool True if the url is valid, false if it is not
Checks to make sure the URL is a relative or absolute path on the existing domain .