From 129b0e99cf581baf6f68f7264e6e3cbbdb5bb973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Fri, 10 Oct 2008 14:35:17 +0000 Subject: [PATCH] Replace jlib:nodeprep/1 by exmpp_stringprep:nodeprep/1 and change the error handling. PR: EJABP-1 SVN Revision: 1619 --- ChangeLog | 3 +++ src/ejabberd_config.erl | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c0625c24..64b64feb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ jlib:nameprep/1 by exmpp_stringprep:nameprep/1 and change the error handling. + * src/ejabberd_config.erl (normalize_hosts/2): Replace jlib:nodeprep/1 + by exmpp_stringprep:nodeprep/1 and change the error handling. + 2008-10-09 Jean-Sébastien Pédron * src/ejabberd_c2s.erl: Fix handling of unauthenticated stanzas which diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 182b4a216..51b228c4f 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -154,13 +154,14 @@ normalize_hosts(Hosts) -> normalize_hosts([], PrepHosts) -> lists:reverse(PrepHosts); normalize_hosts([Host|Hosts], PrepHosts) -> - case jlib:nodeprep(Host) of - error -> + try + PrepHost = exmpp_stringprep:nodeprep(Host), + normalize_hosts(Hosts, [PrepHost|PrepHosts]) + catch + _ -> ?ERROR_MSG("Can't load config file: " "invalid host name [~p]", [Host]), - exit("invalid hostname"); - PrepHost -> - normalize_hosts(Hosts, [PrepHost|PrepHosts]) + exit("invalid hostname") end.