    public function redirect($url)
    {
        if (trim($url) == '') {
            return false;
        }

        $url = str_ireplace('Location:', '', $url);
        $url = trim($url);

        $redirectUrl = site_url();
        $parseUrl = parse_url($url);

        if (isset($parseUrl['host'])) {
            if(isset($parseUrl['user']) and $parseUrl['user']){
                return \Redirect::to(site_url());
            }

            if(isset($parseUrl['pass']) and $parseUrl['pass']){
                return \Redirect::to(site_url());
            }
            if ($parseUrl['host'] == site_hostname()) {
                $redirectUrl = $url;
            }
        }

        $redirectUrl = str_replace("\r", "", $redirectUrl);
        $redirectUrl = str_replace("\n", "", $redirectUrl);

        $clearInput = new HTMLClean();
        $redirectUrl = $clearInput->clean($redirectUrl);

        if (headers_sent()) {
            echo '<meta http-equiv="refresh" content="0;url=' . $redirectUrl . '">';
        } else {
            return \Redirect::to($redirectUrl);
        }
    }
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.