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
1 changed files with 1 additions and 2 deletions

View File

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