Dont unescape URIs which are not escaped
sokoke_uri_unescape_string handles that and handles '+' the way we want.
This commit is contained in:
parent
a770a1b488
commit
f8bf87ecf9
3 changed files with 23 additions and 2 deletions
|
@ -455,7 +455,8 @@ midori_location_action_popup_timeout_cb (gpointer data)
|
|||
icon = action->default_icon;
|
||||
if (type == 1 /* history_view */)
|
||||
{
|
||||
unescaped_uri = g_uri_unescape_string ((const char*)uri, "");
|
||||
unescaped_uri = sokoke_uri_unescape_string ((const char*)uri);
|
||||
|
||||
gtk_list_store_insert_with_values (store, NULL, matches,
|
||||
URI_COL, unescaped_uri, TITLE_COL, title, YALIGN_COL, 0.25,
|
||||
FAVICON_COL, icon, -1);
|
||||
|
|
|
@ -737,6 +737,22 @@ sokoke_magic_uri (const gchar* uri)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* sokoke_uri_unescape_string:
|
||||
* @uri: an URI string
|
||||
*
|
||||
* Unescape @uri if needed, and pass through '+'.
|
||||
*
|
||||
* Return value: a newly allocated URI
|
||||
**/
|
||||
gchar*
|
||||
sokoke_uri_unescape_string (const gchar* uri)
|
||||
{
|
||||
if (strchr (uri,'%'))
|
||||
return g_uri_unescape_string (uri, "+");
|
||||
return g_strdup (uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* sokoke_format_uri_for_display:
|
||||
* @uri: an URI string
|
||||
|
@ -749,9 +765,10 @@ sokoke_magic_uri (const gchar* uri)
|
|||
gchar*
|
||||
sokoke_format_uri_for_display (const gchar* uri)
|
||||
{
|
||||
gchar* unescaped;
|
||||
if (uri && g_str_has_prefix (uri, "http://"))
|
||||
{
|
||||
gchar* unescaped = g_uri_unescape_string (uri, "+");
|
||||
gchar* unescaped = sokoke_uri_unescape_string (uri);
|
||||
#ifdef HAVE_LIBSOUP_2_27_90
|
||||
gchar* path = NULL;
|
||||
gchar* hostname;
|
||||
|
|
|
@ -113,6 +113,9 @@ sokoke_uri_to_ascii (const gchar* uri);
|
|||
gchar*
|
||||
sokoke_magic_uri (const gchar* uri);
|
||||
|
||||
gchar*
|
||||
sokoke_uri_unescape_string (const gchar* uri);
|
||||
|
||||
gchar*
|
||||
sokoke_format_uri_for_display (const gchar* uri);
|
||||
|
||||
|
|
Loading…
Reference in a new issue