From 2bf5b23016ab4929a1c9197907d4a621bb888742 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 26 Feb 2009 13:36:10 -0800 Subject: fix notice in register --- actions/register.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'actions/register.php') diff --git a/actions/register.php b/actions/register.php index 5d7a8ce69..5c6fe39d3 100644 --- a/actions/register.php +++ b/actions/register.php @@ -131,11 +131,13 @@ class RegisterAction extends Action $code = $this->trimmed('code'); + $invite = null; + if ($code) { $invite = Invitation::staticGet($code); } - if (common_config('site', 'inviteonly') && !($code && $invite)) { + if (common_config('site', 'inviteonly') && !($code && !empty($invite))) { $this->clientError(_('Sorry, only invited people can register.')); return; } @@ -341,6 +343,8 @@ class RegisterAction extends Action { $code = $this->trimmed('code'); + $invite = null; + if ($code) { $invite = Invitation::staticGet($code); } @@ -377,7 +381,7 @@ class RegisterAction extends Action _('Same as password above. Required.')); $this->elementEnd('li'); $this->elementStart('li'); - if ($invite && $invite->address_type == 'email') { + if (!empty($invite) && $invite->address_type == 'email') { $this->input('email', _('Email'), $invite->address, _('Used only for updates, announcements, '. 'and password recovery')); -- cgit v1.2.3-54-g00ecf