Be even more picky about invalid URLs

This commit is contained in:
Patrick Griffis 2023-03-14 21:21:22 -05:00
parent 7b093eea91
commit c48afe3799

View File

@ -1065,8 +1065,7 @@ uri_contains_forbidden_characters (const char *uri)
{
while (*uri)
{
/* This is not an exhaustive list, the full URI has segments that allow characters like "[]:" for example. */
if (strchr ("`<> ${}\"+", *uri) != NULL || (*uri & 0x80) /* non-ascii */)
if (!g_ascii_isalnum (*uri) && !strchr ("-._~:/?#[]@!$&'()*+,;=", *uri))
return TRUE;
uri++;
}