public static function safeUrl($url)
    {
        // Strip invalid characters (anything but [a-zA-Z0-9=?&:;#_\/.-])
//        $url = preg_replace("/[^a-zA-Z0-9=?&:;#_\/.-]/", '', $url);

        if (empty($url))
            return '';

        // Prepend http:// if no scheme is specified
        if (!preg_match("/^(https?):\/\//", $url))
            $url = 'http://' . $url;

        if (!self::isURL($url))
            $url = '';

        return filter_var($url,  FILTER_SANITIZE_URL);

    }