diff libpurple/protocols/jabber/jutil.c @ 27539:167d7c3a4f7b

XMPP allows for internationalized domain names. We don't actually support IDNA for connecting (AFAIK), but we need to be able to receive stanzas from such users. This check might be overly accepting of some non-ASCII that wouldn't properly convert according to RFC3490. See http://xmpp.org/internet-drafts/draft-ietf-xmpp-3920bis-00.html#addressing-domain and http://tools.ietf.org/html/rfc3490
author Paul Aurich <paul@darkrain42.org>
date Sat, 11 Jul 2009 00:49:25 +0000
parents 2eba2794423d
children da3d0159333d
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jutil.c	Sat Jul 11 00:05:43 2009 +0000
+++ b/libpurple/protocols/jabber/jutil.c	Sat Jul 11 00:49:25 2009 +0000
@@ -73,11 +73,11 @@
 	while(c && *c) {
 		gunichar ch = g_utf8_get_char(c);
 		/* The list of characters allowed in domain names is pretty small */
-		if (!( (ch >= 'a' && ch <= 'z')
+		if ((ch <= 0x7F && !( (ch >= 'a' && ch <= 'z')
 				|| (ch >= '0' && ch <= '9')
 				|| (ch >= 'A' && ch <= 'Z')
 				|| ch == '.'
-				|| ch == '-' ))
+				|| ch == '-' )) || (ch >= 0x80 && !g_unichar_isgraph(ch)))
 			return FALSE;
 
 		c = g_utf8_next_char(c);