summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-07-18 19:29:46 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-10-24 15:12:57 +0100
commit53141c70899962fbcf88e56d08a7ecd8d5e15f9c (patch)
treedce07b90d3cd53972352965043359774c3a7383d
parentdd38897a26cf888d2c546b7db9da8ec125a37b53 (diff)
downloadnetsurf-53141c70899962fbcf88e56d08a7ecd8d5e15f9c.tar.gz
netsurf-53141c70899962fbcf88e56d08a7ecd8d5e15f9c.tar.bz2
Modify the status bar link text so it shows either the ASCII encoded or IDN host, depending on the set option.
Default is to display the encoded version as this provides some security making phishing domains more obvious, and a lot of our frontends are unable to display the full range of UTF-8 characters on the status bar. Displaying the decoded address in the URL bar requires frontends to be updated (GTK and Amiga done already), and the same caveats apply.
-rw-r--r--render/html_interaction.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 6e2a2df4c..af8417448 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -300,6 +300,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
enum { ACTION_NONE, ACTION_SUBMIT, ACTION_GO } action = ACTION_NONE;
const char *title = 0;
nsurl *url = 0;
+ char *idn_url = NULL;
const char *target = 0;
char status_buffer[200];
const char *status = 0;
@@ -814,12 +815,22 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
y - html_object_pos_y);
}
} else if (url) {
+ if (nsoption_bool(display_decoded_idn) == true) {
+ idn_url = nsurl_access_utf8(url);
+ }
+
if (title) {
snprintf(status_buffer, sizeof status_buffer, "%s: %s",
- nsurl_access(url), title);
- status = status_buffer;
- } else
- status = nsurl_access(url);
+ idn_url ? idn_url : nsurl_access(url), title);
+ } else {
+ snprintf(status_buffer, sizeof status_buffer, "%s",
+ idn_url ? idn_url : nsurl_access(url));
+ }
+
+ status = status_buffer;
+
+ if (idn_url != NULL)
+ free(idn_url);
pointer = get_pointer_shape(url_box, imagemap);