From 0841fa712ec558d283f533690d2db50dfa1da8fc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 30 Mar 2010 17:35:27 -0700 Subject: Ticket #1281: JID validation now more or less follows spec instead of calling e-mail validator Basic splitting/validation code submitted via http://status.net/wiki/XMPP/JID_validation -- Copyright 2009 Patrick Georgi Licensed under ISC-L, which is compatible with everything else that keeps the copyright notice intact. Added PEAR Net_IDNA package to extlib to handle IDN normalization (also used by Validate's email verifier if present). * added test suite, supplemented my own test cases with JID validation and normalization test cases from libpurple * follows XMPP rules for validation of name part * fixes for normalization with non-ASCII names * will do domain checks if $config['email']['check_domain'] is on, checking for an XMPP-server SRV record or any lookup. (We don't actually need to ping those direct though.) * some more obscure stringprep validation rules aren't quite followed yet, but we err on the side of permissiveness. * we still don't actually let you save your address with a resource on it, as we strip resources when looking up users who've sent us presence or message updates. I would recommend saving the outgoing resource as a separate field if/when we add that..? --- actions/imsettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions/imsettings.php') diff --git a/actions/imsettings.php b/actions/imsettings.php index af4915843..c3360fb12 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -292,7 +292,7 @@ class ImsettingsAction extends ConnectSettingsAction $this->showForm(_('Cannot normalize that Jabber ID')); return; } - if (!jabber_valid_base_jid($jabber)) { + if (!jabber_valid_base_jid($jabber, common_config('email', 'domain_check'))) { $this->showForm(_('Not a valid Jabber ID')); return; } else if ($user->jabber == $jabber) { -- cgit v1.2.3-54-g00ecf