if (uri.chr (-1, '@') != null)
return is_ip_address (uri.split ("@")[1]);
/* IPv4 */
- if (uri[0].isdigit () && (uri.chr (4, '.') != null))
+ if (uri[0] != '0' && uri[0].isdigit () && (uri.chr (4, '.') != null))
return true;
/* IPv6 */
if (uri[0].isalnum () && uri[1].isalnum ()
{
g_assert (midori_uri_is_ip_address ("192.168.1.1"));
g_assert (midori_uri_is_ip_address ("192.168.1.1:1234"));
+ g_assert (!midori_uri_is_ip_address ("0.168.1.1"));
g_assert (midori_uri_is_ip_address ("user@192.168.1.1"));
g_assert (midori_uri_is_ip_address ("user:password@192.168.1.1"));
g_assert (midori_uri_is_ip_address ("2001:0db8:85a3:0000:0000:8a2e:0370:7334"));