public static function isValidUrl($url, $requireProtocol = false)
    {
        /*
         * Not a string?
         * Nothing to do
         */
        if (!is_string($url)) {
            return false;
        }

        $pattern = self::getUrlPattern($requireProtocol);

        return (bool)preg_match($pattern, $url);
    }