aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-05-25 10:45:19 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-05-25 10:45:19 +0000
commita995a308a0ea0dbc92d14bb62d1fe1d1c87a355b (patch)
treec9a04df0673adb3d8b6df3b57a46f6a04addf523
parent67d6c453ec8126739d9588cf35bca3a5293a95fb (diff)
fixed phishing check.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@290 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja6
-rw-r--r--src/textview.c28
3 files changed, 26 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a3dc317..f1be0f01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-05-25
+ * src/textview.c: textview_write_link(): also skip non-ascii space
+ at the head of link strings (phishing check didn't work at the case).
+
+2005-05-25
+
* src/utils.c: get_command_output(): use g_spawn_command_line_sync()
instead of popen().
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 234c7173..4e173d7b 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,11 @@
2005-05-25
+ * src/textview.c: textview_write_link(): リンク文字列の先頭の
+ 非 ASCII 空白もスキップするようにした(その場合フィッシングチェック
+ が働かなかった)。
+
+2005-05-25
+
* src/utils.c: get_command_output(): popen() でなく
g_spawn_command_line_sync() を使用するようにした。
diff --git a/src/textview.c b/src/textview.c
index 4cf3a533..46b4f11a 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -1082,7 +1082,9 @@ static void textview_write_link(TextView *textview, const gchar *str,
gchar *bufp;
RemoteURI *r_uri;
- if (*str == '\0')
+ if (!str || *str == '\0')
+ return;
+ if (!uri)
return;
buffer = gtk_text_view_get_buffer(text);
@@ -1095,10 +1097,20 @@ static void textview_write_link(TextView *textview, const gchar *str,
} else
buf = g_strdup(str);
+ if (g_utf8_validate(buf, -1, NULL) == FALSE) {
+ g_free(buf);
+ return;
+ }
+
strcrchomp(buf);
- for (bufp = buf; g_ascii_isspace(*bufp); bufp++)
- ;
+ for (bufp = buf; *bufp != '\0'; bufp = g_utf8_next_char(bufp)) {
+ gunichar ch;
+
+ ch = g_utf8_get_char(bufp);
+ if (!g_unichar_isspace(ch))
+ break;
+ }
if (bufp > buf)
gtk_text_buffer_insert(buffer, &iter, buf, bufp - buf);
@@ -1515,18 +1527,8 @@ static gboolean textview_smooth_scroll_page(TextView *textview, gboolean up)
return TRUE;
}
-#warning FIXME_GTK2
-#if 0
-#define KEY_PRESS_EVENT_STOP() \
- if (gtk_signal_n_emissions_by_name \
- (GTK_OBJECT(widget), "key-press-event") > 0) { \
- gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), \
- "key-press-event"); \
- }
-#else
#define KEY_PRESS_EVENT_STOP() \
g_signal_stop_emission_by_name(G_OBJECT(widget), "key-press-event");
-#endif
static gboolean textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
TextView *textview)