From 0b4390e7f2322a15f16919425de039d555b3e516 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 26 Oct 2009 10:31:12 -0400 Subject: Make email domain checking optional, as some statusnet installations (such as those behind restrictive corporate firewalls, or on home systems on restrictive connections) cannot connect to any mail systems, and this check will always fail. --- actions/emailsettings.php | 2 +- actions/invite.php | 2 +- actions/register.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'actions') diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 6eff06c0d..67b991cdc 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -326,7 +326,7 @@ class EmailsettingsAction extends AccountSettingsAction $this->showForm(_('Cannot normalize that email address')); return; } - if (!Validate::email($email, true)) { + if (!Validate::email($email, common_config('email', 'check_domain'))) { $this->showForm(_('Not a valid email address')); return; } else if ($user->email == $email) { diff --git a/actions/invite.php b/actions/invite.php index 788130c58..3015202e9 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -68,7 +68,7 @@ class InviteAction extends CurrentUserDesignAction foreach ($addresses as $email) { $email = trim($email); - if (!Validate::email($email, true)) { + if (!Validate::email($email, common_config('email', 'check_domain'))) { $this->showForm(sprintf(_('Invalid email address: %s'), $email)); return; } diff --git a/actions/register.php b/actions/register.php index 100ab7424..a6c1a903a 100644 --- a/actions/register.php +++ b/actions/register.php @@ -191,7 +191,7 @@ class RegisterAction extends Action if (!$this->boolean('license')) { $this->showForm(_('You can\'t register if you don\'t '. 'agree to the license.')); - } else if ($email && !Validate::email($email, true)) { + } else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) { $this->showForm(_('Not a valid email address.')); } else if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, -- cgit v1.2.3-54-g00ecf From 7b30e3c00f9fea529ee71a9783006956960ca5e2 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 27 Oct 2009 22:02:55 -0400 Subject: Shorten the notice text after command processing is done --- actions/newnotice.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'actions') diff --git a/actions/newnotice.php b/actions/newnotice.php index 9ee031f93..fe7df0938 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -160,18 +160,12 @@ class NewnoticeAction extends Action if (!$content) { $this->clientError(_('No content!')); - } else { - $content_shortened = common_shorten_links($content); - if (Notice::contentTooLong($content_shortened)) { - $this->clientError(sprintf(_('That\'s too long. '. - 'Max notice size is %d chars.'), - Notice::maxContent())); - } + return; } $inter = new CommandInterpreter(); - $cmd = $inter->handle_command($user, $content_shortened); + $cmd = $inter->handle_command($user, $content); if ($cmd) { if ($this->boolean('ajax')) { @@ -182,6 +176,13 @@ class NewnoticeAction extends Action return; } + $content_shortened = common_shorten_links($content); + if (Notice::contentTooLong($content_shortened)) { + $this->clientError(sprintf(_('That\'s too long. '. + 'Max notice size is %d chars.'), + Notice::maxContent())); + } + $replyto = $this->trimmed('inreplyto'); #If an ID of 0 is wrongly passed here, it will cause a database error, #so override it... -- cgit v1.2.3-54-g00ecf