Always pass a valid URI to gtk_show_uri()

This can fix issues like a crash when invalid characters get passed
through.
This commit is contained in:
Patrick Griffis 2021-06-17 15:22:40 -05:00
parent 09e9d1f749
commit 1f5c95d9e9

View File

@ -1071,7 +1071,9 @@ fe_open_url_inner (const char *url)
#elif defined(__APPLE__)
osx_show_uri (url);
#else
gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL);
char *escaped_url = g_uri_escape_string (url, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS, FALSE);
gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, NULL);
g_free (escaped_url);
#endif
}